在mysql中分组和排序同时使用

在mysql中,分组和排序同时使用时,需要注意配置中的sql_mode是否有only_full_group,如果运行在这个模式下,order by语句中的字段,必须出现在group by中,否则会提示错误

Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nona

  

posted @ 2023-03-23 11:39  热爱交流的程序员  阅读(106)  评论(0)    收藏  举报