{"id":6959,"date":"2024-11-14T09:56:05","date_gmt":"2024-11-14T01:56:05","guid":{"rendered":"https:\/\/fwq.ai\/blog\/6959\/"},"modified":"2024-11-14T09:56:05","modified_gmt":"2024-11-14T01:56:05","slug":"mysql-5-7-%e4%b8%ad%e6%8a%a5%e9%94%99you-cant-specify-target-table-return_data-for-update-in-from-clause%ef%bc%9a%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/6959\/","title":{"rendered":"MySQL 5.7 \u4e2d\u62a5\u9519\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\uff1a\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173018438825294.jpg\" class=\"aligncenter\" title=\"MySQL 5.7 \u4e2d\u62a5\u9519\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\uff1a\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"MySQL 5.7 \u4e2d\u62a5\u9519\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\uff1a\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>FROM \u5b50\u53e5\u4e2d\u7684\u76ee\u6807\u8868\u66f4\u65b0\u65e0\u6548<\/strong><\/p>\n<p>\u5728 MySQL Workbench 6.3 \u4e2d\u53ef\u6267\u884c\u7684\u8bed\u53e5\uff0c\u5728 MySQL 5.7 \u4e2d\u5374\u62a5\u9519\u3002\u8be5\u62a5\u9519\u4e3a\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\u3002\u5982\u4f55\u89e3\u51b3\u6b64\u95ee\u9898\uff1f<\/p>\n<p><strong>\u56de\u7b54\uff1a<\/strong><\/p>\n<p>\u4ece\u9519\u8bef\u4fe1\u606f\u201cspecify target table &#8216;return_data&#8217;\u201d\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u8be5\u95ee\u9898\u5e76\u975e\u7531 MySQL \u7248\u672c\u5dee\u5f02\u5f15\u8d77\u3002<\/p>\n<p>\u9519\u8bef\u539f\u56e0\u662f\u5c1d\u8bd5\u5728\u540c\u4e00 SQL \u8bed\u53e5\u4e2d\u5148\u9009\u62e9\u6307\u5b9a\u8868\u7684\u90e8\u5206\u503c\uff0c\u7136\u540e\u518d\u66f4\u65b0\u8be5\u8868\u3002\u5c06\u76ee\u6807\u8868\u6307\u5b9a\u4e3a FROM \u5b50\u53e5\u4e2d\u7684 update \u5e76\u975e\u6b63\u786e\u505a\u6cd5\u3002<\/p>\n<p>\u4ee5\u4e0b\u94fe\u63a5\u63d0\u4f9b\u4e86\u4e00\u4e2a\u793a\u4f8b\uff0c\u5176\u4e2d\u51fa\u73b0\u4e86\u4e0e\u60a8\u7684\u95ee\u9898\u76f8\u540c\u7684\u9519\u8bef\uff1a<\/p>\n<p>[\u94fe\u63a5\u5230\u7c7b\u4f3c\u9519\u8bef\u7684\u793a\u4f8b]<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL 5.7 \u4e2d\u62a5\u9519\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\uff1a\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FROM \u5b50\u53e5\u4e2d\u7684\u76ee\u6807\u8868\u66f4\u65b0\u65e0\u6548 \u5728 MySQL Workbench 6.3 \u4e2d\u53ef\u6267\u884c\u7684\u8bed\u53e5\uff0c\u5728 MySQL 5.7 \u4e2d\u5374\u62a5\u9519\u3002\u8be5\u62a5\u9519\u4e3a\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\u3002\u5982\u4f55\u89e3\u51b3\u6b64\u95ee\u9898\uff1f \u56de\u7b54\uff1a \u4ece\u9519\u8bef\u4fe1\u606f\u201cspecify target table &#8216;return_data&#8217;\u201d\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u8be5\u95ee\u9898\u5e76\u975e\u7531 MySQL \u7248\u672c\u5dee\u5f02\u5f15\u8d77\u3002 \u9519\u8bef\u539f\u56e0\u662f\u5c1d\u8bd5\u5728\u540c\u4e00 SQL \u8bed\u53e5\u4e2d\u5148\u9009\u62e9\u6307\u5b9a\u8868\u7684\u90e8\u5206\u503c\uff0c\u7136\u540e\u518d\u66f4\u65b0\u8be5\u8868\u3002\u5c06\u76ee\u6807\u8868\u6307\u5b9a\u4e3a FROM \u5b50\u53e5\u4e2d\u7684 update \u5e76\u975e\u6b63\u786e\u505a\u6cd5\u3002 \u4ee5\u4e0b\u94fe\u63a5\u63d0\u4f9b\u4e86\u4e00\u4e2a\u793a\u4f8b\uff0c\u5176\u4e2d\u51fa\u73b0\u4e86\u4e0e\u60a8\u7684\u95ee\u9898\u76f8\u540c\u7684\u9519\u8bef\uff1a [\u94fe\u63a5\u5230\u7c7b\u4f3c\u9519\u8bef\u7684\u793a\u4f8b] \u4ee5\u4e0a\u5c31\u662fMySQL 5.7 \u4e2d\u62a5\u9519\u201cYou can&#8217;t specify target table &#8216;return_data&#8217; for update in FROM clause\u201d\uff1a\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-6959","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6959","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=6959"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/6959\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=6959"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=6959"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=6959"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}