错误提示:
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column ‘information_schema.PROFILING.SEQ‘ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
解决方法:
对于错误err1055查询了很久,说是5.7版本开始对sql的分组查询有了一个语法的检测,对于之前的sql就会出现一些错误,只要吧sqlmodel中的only_full_group_by去掉就行了。
#查询sqlmodel模式:select @@global.sql_mode
设置sqlmodel 模式:SET GLOBAL sql_mode = ‘STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION‘
时间: 2024-10-09 00:41:39