title: Get value from two tables . - Sequelize
body: <p>The query i have been trying to frame in sequelize is below:</p>
  
  <pre><code>select count(a.class_id),b.max_entries from class_entries a,classes b where a.class_id=b.id and b.id=1
  </code></pre>
  
  <p>The below code helps me fetch classEntries count but , I need value of maxentries for a class as well, which i don't know how. Please favour.</p>
  
  <pre><code> db.classEntries.count({
          include:{
            model:db.Classes,
            attributes:['maxEntries'],
            where:{id:coachingId}
  
          }
  
        }).then(counts=&gt;{
          console.log(counts); 
        })
  </code></pre>