title: How to join 3 tables using Sequelize?
body: <p>I have 3 tables named:</p>
  
  <pre><code>    customers
  columns are: id, customer_full_name
  
      transaction_details
  columns are: id, customer_id, amount, merchant_id
  
      merchants
  columns are: id, merchant_full_name
  </code></pre>
  
  <p><code>transaction_details</code> table contains two foreign keys of <code>customer_id</code> and <code>merchant_id</code>.
  One customer may have multiple transactions. One merchant may have multiple transactions too. </p>
  
  <p><strong>Situation:</strong>
  Merchant logins to the website to view the transaction details belong to this merchant. What I would like to display is a table with the following columns:</p>
  
  <pre><code>a. Transaction ID
  b. Customer Name
  c. Transaction Amount
  </code></pre>
  
  <p>My code as below:</p>
  
  <pre><code>  Merchant.findAll({
        where: {
            id:req.session.userId,
        },
        include:[{
          model:TransactionDetails,
          required: false
        }]
      }).then(resultDetails =&gt; {
          var results = resultDetails;
  });
  </code></pre>
  
  <p>My code above does not give me the result that I want. How can I fix this ?</p>