Resolved: Error Code: 1140
I got this error and i tried to fix it with the code given:
set @@global.sql_mode := replace(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', '');
and then to restart MySql service but it still didn't do anything. Is there another way to fix this?(using Windows)
Hi Ioannis!
Thanks for reaching out.
You have to run this query in the Workbench. Could you, please open a new tab and try the same code again? Then, restart the Workbench in order to save the new settings.
Hope this helps.
Best,
Tsvetelin
where should i put this one ?
SET @@global.sql_mode := replace(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', '');
I am experiencing the same error. I used the same code that you sent, and the output still shows the same error.
Thanks for your help.
Hi Aadil and Codjo!
Thanks for reaching out!
Please accept my apologies for the delayed response.
@Aadil: Thank you for providing a potential solution!
@Codjo: Can you please retry rebooting Workbench as well? This should apply the change applied after executing the code suggested by Aadil.
Hope this helps but please feel free to get back to us should you need further assistance. Thank you.
Kind regards,
Martin
Thanks for reaching out.
Thank you for the suggestion!
GROUP BY e.emp_no is indeed used when a query contains aggregate functions.In this example, however, the
SELECT statement doesn’t use any aggregates, so adding a GROUP BY isn’t required and would actually change the logic of the query.The
JOIN and the WHERE clause are enough for this procedure.Hope this helps.
Best,
Tsvetelin
