小编usr*_*ΛΩΝ的帖子

在 MySQL 5.7.13 和 5.7.11 中容忍 SQL 错误(orderby not in distinct,select not in group by)

此问题与以下 2 个 SQL 错误有关(我添加的换行符)

MySql.Data.MySqlClient.MySqlException (0x80004005):
Expression #2 of ORDER BY clause is not in SELECT list, references column 'auitool2014.a.prog' which is not in SELECT list;
this is incompatible with DISTINCT


MySql.Data.MySqlClient.MySqlException (0x80004005): 
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'H.C51' which is not functionally dependent on columns in GROUP BY clause; 
this is incompatible with sql_mode=only_full_group_by
Run Code Online (Sandbox Code Playgroud)

我的问题很容易描述,即使没有发布原始 SQL。我有一个5.7.11-log在 Windows 上运行的 Mysql服务器,我可以SELECT A,B GROUP BY A并且SELECT …

mysql syntax group-by distinct mysql-5.7

5
推荐指数
1
解决办法
1243
查看次数

标签 统计

distinct ×1

group-by ×1

mysql ×1

mysql-5.7 ×1

syntax ×1