{"id":46224,"date":"2019-09-02T09:14:26","date_gmt":"2019-09-02T01:14:26","guid":{"rendered":"http:\/\/www.xyryd.com\/?p=46224"},"modified":"2019-09-02T09:14:28","modified_gmt":"2019-09-02T01:14:28","slug":"mysql-%e5%87%ba%e7%8e%b0-which-is-not-functionally-dependent-on-columns-in-group-by-clause-this-is-incompatible-with-sql_modeonly_full_group_by%e9%94%99%e8%af%af-%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.xyryd.com\/46224.html","title":{"rendered":"MySQL \u51fa\u73b0 which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by\u9519\u8bef \u89e3\u51b3\u529e\u6cd5 \u56fe\u6587\u6559\u7a0b"},"content":{"rendered":"\n
\u8001\u5b63\u5728\u63a5\u89e6\u5230\u7684\u4e00\u4e2a\u9879\u76ee\u4e2d\uff0c\u5bfc\u5165MYSQL\u6587\u4ef6\u4e4b\u540e\u51fa\u73b0\u4e86\u9519\u8bef\uff0c\u5177\u4f53\u9519\u8bef\u5982\u4e0b\uff1a<\/p>\n\n\n\n
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column ‘poweridc.t.id’ which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by<\/p><\/blockquote>\n\n\n\n
\u67e5\u8be2MySQL\u7248\u672c\u53ef\u4ee5\u5728\u547d\u4ee4\u884c\u6a21\u5f0f\u521a\u8fde\u63a5\u4e0a\u6570\u636e\u5e93\u65f6\u5c31\u80fd\u770b\u5230,\u6216\u8005\u5728\u8fdb\u5165mysql\u540e\u4f7f\u7528\u547d\u4ee4:status\u67e5\u770b\u7248\u672c\u53f7,<\/p>\n\n\n\n
\u65e2\u7136\u662f\u7248\u672c\u7684\u95ee\u9898,\u90a3\u5c31\u67e5\u8be2\u4e00\u4e0b\u914d\u7f6e\u770b\u770b\u5177\u4f53\u7684\u60c5\u51b5,\u547d\u4ee4\u884c\u8fde\u63a5\u4e0a\u6570\u636e\u5e93,\u518d\u8f93\u5165\u547d\u4ee4:<\/p>\n\n\n\n
select @@sql_mode<\/strong>;<\/pre>\n\n\n\nsql_mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION<\/p><\/blockquote>\n\n\n\n