This is the error that I am getting
Error Code: 1055. Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'employees.d.dept_no' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
This is dit-dot same code used by my instructor
SELECT
m.dept_no, m.emp_no, d.dept_name
FROM
dept_manager_dup m
LEFT JOIN
departments_dup d ON m.dept_no = d.dept_no
GROUP BY
m.emp_no
ORDER BY
m. dept_no;
He was able to execute it but I couldn't. I am getting the same error all the time.
I said the same to the instructor so he insisted me to run this code and restart MySQL.
INSTRUCTOR SUGGESTION to solve the error
set @@global.sql_mode := replace(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', '');
I also did the same but nothing changed and got the same errors again and again.
Could someone please help me in getting clarity about it I've just started to learn this sql which is very important to me.
Hope I will get a appropriated solution for my issue. Thank you