SQL报错:ONLY_FULL_GROUP_BY---SQL语句规范性检查


only_full_group_by的作用是就是一个SQL语句合法性的检查。

含义:sql中select后面的字段必须出现在group by后面,或者被聚合函数包裹,不然会抛出上面的错误 

如:

select A,B,C,sum(E)from table group by A ; #报错

select A,B,C,sum(E)from table group by A,B,C; #不会报错

或改为 :

select A,any_value(B),any_value(C),sum(E)from table group by A;

SQL