Search This Blog

Monday, September 17, 2018

How to Disable ONLY_FULL_GROUP_BY SQL mode in MySQL

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

Adding a mode to sql_mode:

SET sql_mode=(SELECT CONCAT(@@sql_mode,',<mode_to_add>'));

Removing a mode from sql_mode:

SET sql_mode=(SELECT REPLACE(@@sql_mode,'<mode_to_remove>',''));