mybatisplus
作者:互联网
问题原因:
mysql5.7.5及以上版本将sql_mode的ONLY_FULL_GROUP_BY模式默认设置为打开状态,会导致一些错误:
1、我们使用GROUP BY查询时,出现在SELECT字段后面的只能是GROUP
BY后面的分组字段,或使用聚合函数包裹着的字段,否则会报错如下信息: Expression #1 of SELECT list is
not in GROUP BY clause and contains nonaggregated column
‘database.table.column’ which is not functionally dependent on columns
in GROUP BY clause; this is incompatible with
sql_mode=only_full_group_by
2、当使用ORDER BY查询时,不能使用SELECT
DISTINCT去重查询。否则会报错如下信息: Expression #1 of ORDER BY clause is not in
SELECT list, references column ‘database.table.column’ which is not in
SELECT list; this is incompatible with DISTINCT
————————————————
版权声明:本文为CSDN博主「贰拾。」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_44983122/article/details/122460015
标签:GROUP,column,clause,list,查询,报错,mybatisplus 来源: https://www.cnblogs.com/shirleyxueli/p/16496322.html