title: Sequelize query of Sum aggregate functions in Node js
body: <p>I am actually trying to get all the active and inactive users in one query using this query </p>
  
  <pre><code>SELECT SUM(CASE WHEN users.status = 1 THEN 1 ELSE 0 END) AS 'Active_players', SUM(CASE WHEN users.status = 0 THEN 1 ELSE 0 END) AS `InActive_players` FROM `users` AS `users` INNER JOIN `organization_entries` AS `organizationEntries` ON `users`.`id` = `organizationEntries`.`user_id` AND `organizationEntries`.`organization_id` = '1' AND `organizationEntries`.`type` = '001';
  </code></pre>
  
  <p>but I am not able to understand how to write this query using Sequelize query.</p>
  
  <p>I have tried this link <a href="http://docs.sequelizejs.com/manual/tutorial/querying.html" rel="nofollow noreferrer">http://docs.sequelizejs.com/manual/tutorial/querying.html</a> but could not understand properly how to implement it using sequelize.</p>