Mysql query statement group by statement error

The higher version of mysql will report an error when there is group by in the query statement, and the error message is as follows

> 1055 - Expression #40 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'dsjpt.sys_fl_task.node_name' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

The solution is to open navicat and press F6 to bring up the command line and
press the code to execute it once and it will be fine


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';

set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,

ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
 

Guess you like

Origin blog.csdn.net/weixin_65846839/article/details/132046230