Last answered:

14 May 2020

Posted on:

12 May 2020

0

Still get an error message in Duplicate Records lesson

Hi there, I am rewatching the lesson on Duplicate Records in JOINs and I executed that code in an earlier lecture to prevent the error message but I am still getting the 1055 error message after this: SELECT
m.dept_no, m.emp_no, d.dept_name
FROM
dept_manager_dup m
JOIN
departments_dup d ON m.dept_no = d.dept_no
GROUP BY m.emp_no
ORDER BY dept_no; I am using MacOS 10.15.4 and and Workbench 8.0.19 Let me know how I can solve this? Thanks.
1 answers ( 0 marked as helpful)
Instructor
Posted on:

14 May 2020

1
Hi Yunfeng! Thanks for reaching out. Please make sure to reconnect to the server after you execute the relevant SET Statement. Then, the code is indeed correct.  To sum up, here's the order in which you need to execute the relevant operations, the second one being pressing the icon that has been underlined in red on the picture below.
SET @@global.sql_mode := replace(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', '');
SELECT 
m.dept_no, m.emp_no, d.dept_name
FROM
dept_manager_dup m
JOIN
departments_dup d ON m.dept_no = d.dept_no
GROUP BY m.emp_no
ORDER BY dept_no;
Hope this helps.
Best,
Martin

Submit an answer