zoukankan      html  css  js  c++  java
  • 在使用GROUP BY对Mysql的数据表进行查询时如果出现以下错误

    在使用GROUP BY对Mysql的数据表进行查询时如果出现以下错误

    ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause
    and contains nonaggregated column 'player.song_sheet.type' which is not
    functionally dependent on columns  in GROUP BY clause; this is
    incompatible with sql_mode=only_full_group_by

    解决方法1:

    1.查询mysql 相关mode

    可以看到模式中包含了ONLY_FULL_GROUP_BY,只要没有这个配置即可。

    我的Mysql版本是5.7.23,默认是带了ONLY_FULL_GROUP_BY模式。

    2.重设模式值

    解决方法2:

    打开mysql配置文件:my.cnf,直接选择打开mysql配置文件,然后在最底部添加

    重启mysql即可

  • 相关阅读:
    20171012
    BZOJ[2563] 阿狸和桃子的游戏
    BZOJ[1028] [JSOI2007]麻将
    BZOJ[1972] [Sdoi2010]猪国杀
    BZOJ[1033] [ZJOI2008] 杀蚂蚁antbuster
    P5651 基础最短路练习题
    P3047 [USACO12FEB]Nearby Cows G
    P6190 魔法
    P2391 白雪皑皑 / BZOJ 2054 疯狂的馒头
    CSP 2020 J/S 初赛游记
  • 原文地址:https://www.cnblogs.com/cainiaoaixuexi/p/14689925.html
Copyright © 2011-2022 走看看