{"id":629,"date":"2024-11-25T18:12:52","date_gmt":"2024-11-25T10:12:52","guid":{"rendered":"http:\/\/www.chan.ink\/?p=629"},"modified":"2024-11-25T18:12:55","modified_gmt":"2024-11-25T10:12:55","slug":"%e3%80%90mysql%e3%80%91sql_modeonly_full_group_by","status":"publish","type":"post","link":"http:\/\/www.chan.ink\/index.php\/2024\/11\/25\/%e3%80%90mysql%e3%80%91sql_modeonly_full_group_by\/","title":{"rendered":"\u3010MySQL\u3011sql_mode=only_full_group_by"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">ERROR 1055 (42000): Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column &#8216;day27db.student.sname&#8217; which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u9519\u8bef\u662f\u56e0\u4e3a MySQL \u7684 <code>sql_mode<\/code> \u914d\u7f6e\u4e2d\u542f\u7528\u4e86 <code>ONLY_FULL_GROUP_BY<\/code> \u6a21\u5f0f\u3002\u8fd9\u4e2a\u6a21\u5f0f\u8981\u6c42\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SELECT \u4e2d\u7684\u6240\u6709\u975e\u805a\u5408\u5217<\/strong>\u5fc5\u987b\u51fa\u73b0\u5728 <code>GROUP BY<\/code> \u5b50\u53e5\u4e2d\uff0c\u6216\u8005\u662f<strong>\u805a\u5408\u51fd\u6570\u7684\u7ed3\u679c<\/strong>\u3002<\/li>\n\n\n\n<li>\u5982\u679c\u4e00\u5217\u4e0d\u5728 <code>GROUP BY<\/code> \u5b50\u53e5\u4e2d\uff0c\u800c\u53c8\u4e0d\u662f\u901a\u8fc7\u805a\u5408\u51fd\u6570\u8ba1\u7b97\u5f97\u51fa\u7684\uff0cMySQL \u65e0\u6cd5\u786e\u5b9a\u5e94\u8be5\u8fd4\u56de\u54ea\u4e00\u884c\u7684\u503c\uff0c\u56e0\u6b64\u4f1a\u62a5\u9519<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>ERROR 1055 (42000): Expression #1 of SELECT list is not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-629","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/comments?post=629"}],"version-history":[{"count":1,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/629\/revisions"}],"predecessor-version":[{"id":630,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/posts\/629\/revisions\/630"}],"wp:attachment":[{"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/media?parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/categories?post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.chan.ink\/index.php\/wp-json\/wp\/v2\/tags?post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}