ORDER BY clause is not in SELECT list

这是因为当前 MySQL 的 sql_mode 配置中有 only_full_group_by。将这项移掉就行。

不需要考虑那么细的话,直接编辑 my.cnf 文件,将sql_mode=''加到[mysqld]配置项下,重启 MySQL。

参考:php - How to resolve "ORDER BY clause is not in SELECT list" caused MySQL 5.7 with SELECT DISTINCT and ORDER BY - Stack Overflow

posted @ 2024-03-24 13:40  Higurashi-kagome  阅读(54)  评论(0编辑  收藏  举报