sqle icon indicating copy to clipboard operation
sqle copied to clipboard

MySQL增加ONLY_FULL_GROUP_BY规则

Open littleniannian opened this issue 9 months ago • 0 comments

需求描述(Describe)

客户反馈在MySQL数据库中存在一些违反ONLY_FULL_GROUP_BY的SQL,影响查询结果,有不准的风险。

  1. 显式GROUP BY,所有非聚合列都需要包含在GROUP BY的后面。
  2. 隐式DISTINCT,使用distinct的时候MYSQL会进行隐式的分组,因为DISTINCT需要确保每个组合的唯一性。

实现方案

变更影响面

受影响的模块或功能

外部引用的潜在问题或风险

版本兼容性

测试建议

littleniannian avatar Mar 07 '25 08:03 littleniannian