title: Using group with Inner Join in Sequelize giving error
body: <p>I am trying to write this raw query  </p>
  
  <pre><code>SELECT users.status,count(`users`.`id`) AS `count` 
  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' 
  group by users.status;
  </code></pre>
  
  <p>in Sequelize .</p>
  
  <p>I have written this query in Sequelize like this </p>
  
  <pre><code>db.users
      .findAll({
        attributes: [
          'status',
          [db.sequelize.fn('COUNT', 'users.id'), 'entries']
        ],
        include: {
          model: db.organizationEntries,
          where: {
  
  
            organization_id: req.params.org_id,
            type: '001',
  
          },
        },
        group: ['users.status']
      }).then(c =&gt; {
        console.log(c);
  
        let active_users = {
          active_users: c,
        }
        return res.send(active_users);
  
      })
      .catch(next);
  </code></pre>
  
  <p>but when I am running this query I am getting this error </p>
  
  <blockquote>
    <p>code  "ER_WRONG_FIELD_WITH_GROUP" errno   1055 sqlState   "42000"</p>
    
    <p>sqlMessage    "Expression #1 of SELECT list is not in GROUP BY clause and
    contains nonaggregated column 'ontro.users.id' which is not
    functionally dependent on columns in GROUP BY clause; this is
    incompatible with sql_mode=only_full_group_by"</p>
  </blockquote>
  
  <p>I am not able to understand what I am doing wrong.</p>