Last answered:

22 Nov 2023

Posted on:

13 Nov 2023

0

how to solve this

0
39
19:51:51
SELECT     m.dept_no, m.emp_no, d.dept_name FROM     dept_manager_dup m         INNER JOIN     department_dup d ON m.dept_no = d.dept_no   group by m.emp_no ORDER BY m.dept_no
Error Code: 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.000 sec

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

13 Nov 2023

0

Hi Magesh!
Thanks for reaching out.


Depending on your operating system and version of MySQL, you will be working with different SQL settings.

To make sure you can take some of the remaining lectures of the course without unnecessary interruption, we strongly advise you to execute the following query now.

set @@global.sql_mode := replace(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', '');

Then, restart the Workbench in order to save the new settings.


Hope this helps.
Best,
Tsvetelin

Posted on:

14 Nov 2023

0

after executing the command the code is working but no of rows affected is still zero ??

Instructor
Posted on:

22 Nov 2023

0

Hi Magesh!
Thanks for reaching out.


If the command SET @@global.sql_mode := REPLACE(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', ''); affected 0 rows, it means that the 'ONLY_FULL_GROUP_BY' setting was not present in the sql_mode to begin with, or it was successfully removed.

The '0 rows affected' message in this context is not indicative of an error or problem. It's simply stating that the global SQL mode setting has been updated, but no data rows were "affected" because this operation alters a server configuration rather than modifying data in a database table.


Hope this helps.
Best,
Tsvetelin

Submit an answer