Disable ONLY_FULL_GROUP_BY

后端 未结 27 1311
既然无缘
既然无缘 2020-11-22 00:22

I accidentally enabled ONLY_FULL_GROUP_BY mode like this:

SET sql_mode = \'ONLY_FULL_GROUP_BY\';

How do I disable it?

27条回答
  •  鱼传尺愫
    2020-11-22 00:59

    Be careful using

    SET sql_mode = '' 
    

    This actually clears all the modes currently enabled. If you don't want to mess with other settings, you'll want to do a

    SELECT @@sql_mode 
    

    first, to get a comma-separated list of the modes enabled, then SET it to this list without the ONLY_FULL_GROUP_BY option.

提交回复
热议问题