Skip to content

Instantly share code, notes, and snippets.

@akramhossainrabbi
Last active November 22, 2023 07:27
Show Gist options
  • Select an option

  • Save akramhossainrabbi/46f449637e4203fe7c4fb051808f9196 to your computer and use it in GitHub Desktop.

Select an option

Save akramhossainrabbi/46f449637e4203fe7c4fb051808f9196 to your computer and use it in GitHub Desktop.
Can't use GROUP BY in mysql 8 and above? Here's the solution!

Can't use GROUP BY in mysql 8 and above? Here's the solution!

Remove ONLY_FULL_GROUP_BY from mysql console

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Be aware that this setting is NOT persistent across restarts, then use

SET PERSIST sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment