在使用用Navicate过程中,运行代码经常出现1055error。
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated c
运行下面的sql语句,1055错误就消失了!
方法一、复制下面的sql语句运行成功
show variables like "sql_model";
set sql_mode="";
set sql_mode="no_engine_substitution,strict_trans_tables";
结果如下:
方法二、复制这一条sql语句运行成功
select @@global.sql_mode;
set @@global.sql_mode = 'STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
运行结果如下: