MySQL发生[Err] 1055的解决方案
在使用group by时,如果group by后面的字段和所要查询的字段不完全一样时会报如下错误
[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
此时有两种解决方案
方案一:临时修改(服务器重启后会失效)
-- 通过该语句查询这个值 --
select @@sql_mode;
会得到如下结果: