Error Code: 1055 incompatible with sql_mode=only_full_group_by

后端 未结 6 1323
予麋鹿
予麋鹿 2020-12-01 05:49

I have been having issues switching to an offline version of the Lahman SQL baseball database. I was using a terminal embed into an EDX course. This command runs fine on the

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 06:16

    In 5.7 the sqlmode is set by default to:

     ONLY_FULL_GROUP_BY,NO_AUTO_CREATE_USER,STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION
    

    To remove the clause ONLY_FULL_GROUP_BY you can do this:

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

    This supposed you need to make that GROUP BY with non aggregated columns.

    Regards

提交回复
热议问题