title: MySql query in laravel 5.4 with inner join and count
body: <p>My sql query shows correct in phpmyadmin but when I use it in laravel 5.4 project it shows error</p>
  
  <blockquote>
    <p>SQLSTATE[42000]: Syntax error or access violation: 1055 'project_management.addprojects.id' isn't in GROUP BY (SQL: SELECT DISTINCT addprojects.id,addprojects.emp_id,sum(tasks.task_weight),tasks.flag from addprojects JOIN tasks ON tasks.proj_id = addprojects.id GROUP BY tasks.proj_id )</p>
  </blockquote>
  
  <pre><code>DB::select(" SELECT DISTINCT addprojects.proj_name,addprojects.id,
     addprojects.emp_id,sum(tasks.task_weight),tasks.flag from addprojects 
    JOIN tasks ON tasks.proj_id = addprojects.id GROUP BY tasks.proj_id ");
  </code></pre>