Posted on:

26 Jun 2023


Duplicate Records

Hello Martin and Team,

                                      So far everything was going on well with the lecture course until I got stuck on this query on the topic of Duplicate Records. 

The error comes when I execute the query after I added the GROUP BY clause from the previous lectures, Sir Martin started that the GROUP BY clause is normally 

used with an Aggregated Function but the query from the example doesn't seem to have the aggregated function nor where clause. Can I get assistance why my query is resulting in an error I followed that exam the same steps as Sir Martin in the lecture course.

SELECT m.dept_no, m.emp_no, d.dept_name
dept_manager_dup m
departments_dup d
ON m.dept_no = d.dept_no
GROUP BY m.emp_no
ORDER BY dept_no;

Querry Summary:

1055 - Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'employees.m.dept_no' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by


0 answers ( 0 marked as helpful)

Submit an answer