Last answered:

07 Mar 2025

Posted on:

07 Mar 2025

0

Resolved: Joins and Duplicate records

Why is there an error while removing the duplicate records? And how specifically the Group by clause works for removing the duplicates?

Pls view the attached screenshot.

3 answers ( 1 marked as helpful)
Instructor
Posted on:

07 Mar 2025

0
Hi Saurav!
Thanks for reaching out.

You have to disable the ONLY_FULL_GROUP_BY  mode in order to resolve the 1055 error message. Please, use the following code:
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); 
Then, restart Workbench in order to save the new settings.
Group by gathers rows with the same values into single groups. This helps eliminate duplicate rows by showing only one result for each group.

Hope this helps.
Best,
Tsvetelin
Posted on:

07 Mar 2025

0
Thanks! This worked.
Instructor
Posted on:

07 Mar 2025

0

Hi Saurav!


You are very welcome!


Best,
The 365 Team

Submit an answer