欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL

程序员文章站 2023-10-17 10:26:32
问题:[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which ......

问题[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 version(),
@@sql_mode;set sql_mode=(select replace(@@sql_mode,'only_full_group_by',''));

 

 

 

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL

 

完美的解决方案是:

 

1 show variables like "sql_mode";
2 
3 set sql_mode='';
4 set sql_mode='no_engine_substitution,strict_trans_tables';

[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL