My sql query shows correct in phpmyadmin but when I use it in laravel 5.4 project it shows error
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 )
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 ");