Last answered:

10 Nov 2023

Posted on:

18 Mar 2023

0

Resolved: Getting error code 1140 even after trying the fixes.

Still gtting error code 1140 even after applying the fixes from another persons question. I made sure to restart MySQL after each fix. Any help?

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

20 Mar 2023

0

Hi Donald!
Thanks for reaching out!


Please, remove the concat() method. Actually, you first remove this mode and then you add it. You have to run only:

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

and then restart the Workbench.


Hope this helps.
Best,
Tsvetelin

Posted on:

21 Mar 2023

0

Ok that worked Thanks!

Instructor
Posted on:

26 Mar 2023

0

You are very welcome!
Kind regards,
Martin,
The 365 Team


Posted on:

24 Jul 2023

0

I am just running the replace method, but still am getting the same error. Could you help me out and at same time eplxain what is this replace and contact method?


 

Instructor
Posted on:

23 Aug 2023

0

Hi Saeed!
Thanks for reaching out.


These are methods. The REPLACE() method replaces all occurrences of a substring within a string, with a new substring. The CONCAT() method adds two or more strings together. In order to resolve the issue, you should restart the Workbench or reconnect to the server.


Hope this helps.
Best,
Tsvetelin

Posted on:

05 Oct 2023

0

Hi,

Even though I have implemented the procedure to solve the Error code 1140, it still comes up.

so:

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

Then:

Restart MySql application.

Then execute call code:

CALL emp_avg_salary(11300);

This is not working for me.

Can you please assist.

Thank you.

Instructor
Posted on:

10 Nov 2023

0

Hi Maurice!
Thanks for reaching out.


To fix MySQL error 1140 after setting `sql_mode` without `ONLY_FULL_GROUP_BY` and restarting MySQL, ensure the `sql_mode` change is persistent by editing the MySQL configuration file. If the error persists, check the `emp_avg_salary` procedure for issues unrelated to `GROUP BY`. Confirm all selected columns in `GROUP BY` queries are properly aggregated or listed in the clause. Test the query outside the procedure, and consult MySQL documentation or forums with the exact error message for more help.


Hope this helps.
Best,
Tsvetelin

Submit an answer