Skip to content

Instantly share code, notes, and snippets.

@gauravds
Last active February 2, 2024 13:19
Show Gist options
  • Save gauravds/c2cefb428d9741282e88afb1c3afa17b to your computer and use it in GitHub Desktop.
Save gauravds/c2cefb428d9741282e88afb1c3afa17b to your computer and use it in GitHub Desktop.
sql mode to support ONLY_FULL_GROUP_BY by setting this `NO_ENGINE_SUBSTITUTION`
SELECT @@sql_mode;
SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
SET SESSION sql_mode = 'NO_ENGINE_SUBSTITUTION';
-- other commands
SELECT @@sql_mode;
SET GLOBAL sql_mode=(SELECT CONCAT(@@sql_mode,',ONLY_FULL_GROUP_BY'));
SET GLOBAL sql_mode = 'ONLY_FULL_GROUP_BY';
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
-- ref https://stackoverflow.com/a/35018178/1084917
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment