How to resolve “ORDER BY clause is not in SELECT list” caused MySQL 5.7 with SELECT DISTINCT and ORDER BY

前端 未结 8 875
故里飘歌
故里飘歌 2020-12-29 20:21

I installed the new Ubuntu and my code has got a problem with MySQL.

( ! ) Warning: PDOStatement::execute(): SQLSTAT         


        
8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 20:43

    You can run as said :

    SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
    SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
    

提交回复
热议问题