{"id":826,"date":"2009-06-06T18:58:42","date_gmt":"2009-06-06T09:58:42","guid":{"rendered":"https:\/\/wp-78qb7hnp.pistolfly.jp\/weblog\/2009\/06\/you-cant-specify-target-table.html"},"modified":"2016-03-28T14:30:28","modified_gmt":"2016-03-28T05:30:28","slug":"you-cant-specify-target-table","status":"publish","type":"post","link":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html","title":{"rendered":"You can't specify target table 'xxx' for update in FROM clause"},"content":{"rendered":"<p>MySQL\u3067\u306f\u3001\u30b5\u30d6\u30af\u30a8\u30ea FROM \u7bc0\u3068\u66f4\u65b0\u5bfe\u8c61\u306e\u4e21\u65b9\u306b\u540c\u3058\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d<br \/>\n\u306a\u3044\u3002<\/p>\n<p>Source: <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/ja\/subquery-errors.html\" target=\"_blank\">MySQL :: MySQL 5.1 \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb :: 12.2.8.9 \u30b5\u30d6\u30af\u30a8\u30ea \u30a8\u30e9\u30fc<\/a><\/p>\n<pre class=\"command-line\">mysql&gt; delete from user \\\r\n    -&gt; where user.id in \\\r\n    -&gt; (select user.id from user \\\r\n    -&gt; left join reserve_data on user.id = reserve_data.user_id where reserve_data.id is null);\r\nERROR 1093 (HY000): You can't specify target table 'user' for update in FROM clause\r\n<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306a\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"command-line\">mysql&gt; delete from user \\\r\n    -&gt; where user.id in \\\r\n    -&gt; (select x.id from \\\r\n    -&gt; (select user.id from user left join reserve_data on user.id = reserve_data.user_id where reserve_data.id is null) \\\r\n    -&gt; as x \\\r\n    -&gt; );\r\nQuery OK, 350 rows affected (0.00 sec)\r\n<\/pre>\n<p>\u3053\u3046\u3059\u308b\u3068\u3001\u6697\u9ed9\u7684\u306b\u4e00\u6642\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u3046\u307e\u304f\u3044\u304f\u3002<\/p>\n<p>Source: <a href=\"http:\/\/stackoverflow.com\/questions\/45494\/sql-delete-cant-specify-target-table-for-update-in-from-clause\" target=\"_blank\">SQL Delete: can't specify target table for update in FROM clause - Stack Overflow<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL\u3067\u306f\u3001\u30b5\u30d6\u30af\u30a8\u30ea FROM \u7bc0\u3068\u66f4\u65b0\u5bfe\u8c61\u306e\u4e21\u65b9\u306b\u540c\u3058\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d \u306a\u3044\u3002 Source: MySQL :: MySQL 5.1 \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb :: 12.2.8.9 \u30b5\u30d6\u30af\u30a8\u30ea \u30a8\u30e9\u30fc &hellip; <a href=\"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">You can't specify target table 'xxx' for update in FROM clause<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"826","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-826","post","type-post","status-publish","format-standard","hentry","category-mysql","ja"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>You can&#039;t specify target table &#039;xxx&#039; for update in FROM clause - Pistolfly<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"You can&#039;t specify target table &#039;xxx&#039; for update in FROM clause - Pistolfly\" \/>\n<meta property=\"og:description\" content=\"MySQL\u3067\u306f\u3001\u30b5\u30d6\u30af\u30a8\u30ea FROM \u7bc0\u3068\u66f4\u65b0\u5bfe\u8c61\u306e\u4e21\u65b9\u306b\u540c\u3058\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d \u306a\u3044\u3002 Source: MySQL :: MySQL 5.1 \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb :: 12.2.8.9 \u30b5\u30d6\u30af\u30a8\u30ea \u30a8\u30e9\u30fc &hellip; \u7d9a\u304d\u3092\u8aad\u3080 You can&#039;t specify target table &#039;xxx&#039; for update in FROM clause &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html\" \/>\n<meta property=\"og:site_name\" content=\"Pistolfly\" \/>\n<meta property=\"article:published_time\" content=\"2009-06-06T09:58:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-28T05:30:28+00:00\" \/>\n<meta name=\"author\" content=\"Pistolfly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pistolfly\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html\"},\"author\":{\"name\":\"Pistolfly\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"headline\":\"You can't specify target table 'xxx' for update in FROM clause\",\"datePublished\":\"2009-06-06T09:58:42+00:00\",\"dateModified\":\"2016-03-28T05:30:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html\"},\"wordCount\":33,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"articleSection\":[\"MySQL\"],\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html\",\"name\":\"You can't specify target table 'xxx' for update in FROM clause - Pistolfly\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\"},\"datePublished\":\"2009-06-06T09:58:42+00:00\",\"dateModified\":\"2016-03-28T05:30:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/2009\\\/06\\\/you-cant-specify-target-table.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u30db\u30fc\u30e0\",\"item\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"You can't specify target table 'xxx' for update in FROM clause\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#website\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/\",\"name\":\"Pistolfly\",\"description\":\"Developer Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/#\\\/schema\\\/person\\\/e779e918730b507907b3a35b77a9a2ab\",\"name\":\"Pistolfly\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\",\"caption\":\"Pistolfly\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g\"},\"description\":\"Software Engineer in Tokyo, Japan\",\"url\":\"https:\\\/\\\/www.pistolfly.com\\\/weblog\\\/author\\\/pistolfly\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"You can't specify target table 'xxx' for update in FROM clause - Pistolfly","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html","og_locale":"ja_JP","og_type":"article","og_title":"You can't specify target table 'xxx' for update in FROM clause - Pistolfly","og_description":"MySQL\u3067\u306f\u3001\u30b5\u30d6\u30af\u30a8\u30ea FROM \u7bc0\u3068\u66f4\u65b0\u5bfe\u8c61\u306e\u4e21\u65b9\u306b\u540c\u3058\u30c6\u30fc\u30d6\u30eb\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d \u306a\u3044\u3002 Source: MySQL :: MySQL 5.1 \u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u30de\u30cb\u30e5\u30a2\u30eb :: 12.2.8.9 \u30b5\u30d6\u30af\u30a8\u30ea \u30a8\u30e9\u30fc &hellip; \u7d9a\u304d\u3092\u8aad\u3080 You can't specify target table 'xxx' for update in FROM clause &rarr;","og_url":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html","og_site_name":"Pistolfly","article_published_time":"2009-06-06T09:58:42+00:00","article_modified_time":"2016-03-28T05:30:28+00:00","author":"Pistolfly","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"Pistolfly","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"1\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html#article","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html"},"author":{"name":"Pistolfly","@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"headline":"You can't specify target table 'xxx' for update in FROM clause","datePublished":"2009-06-06T09:58:42+00:00","dateModified":"2016-03-28T05:30:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html"},"wordCount":33,"commentCount":2,"publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"articleSection":["MySQL"],"inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html","url":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html","name":"You can't specify target table 'xxx' for update in FROM clause - Pistolfly","isPartOf":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#website"},"datePublished":"2009-06-06T09:58:42+00:00","dateModified":"2016-03-28T05:30:28+00:00","breadcrumb":{"@id":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.pistolfly.com\/weblog\/2009\/06\/you-cant-specify-target-table.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u30db\u30fc\u30e0","item":"https:\/\/www.pistolfly.com\/weblog"},{"@type":"ListItem","position":2,"name":"You can't specify target table 'xxx' for update in FROM clause"}]},{"@type":"WebSite","@id":"https:\/\/www.pistolfly.com\/weblog\/#website","url":"https:\/\/www.pistolfly.com\/weblog\/","name":"Pistolfly","description":"Developer Blog","publisher":{"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pistolfly.com\/weblog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pistolfly.com\/weblog\/#\/schema\/person\/e779e918730b507907b3a35b77a9a2ab","name":"Pistolfly","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g","caption":"Pistolfly"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/0b3ddb2859adabf28a2b97ae9fff98772ddffc46088d11cad2b9a2cef66115e7?s=96&d=mm&r=g"},"description":"Software Engineer in Tokyo, Japan","url":"https:\/\/www.pistolfly.com\/weblog\/author\/pistolfly"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paorzz-dk","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/comments?post=826"}],"version-history":[{"count":1,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/826\/revisions"}],"predecessor-version":[{"id":3470,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/posts\/826\/revisions\/3470"}],"wp:attachment":[{"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/media?parent=826"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/categories?post=826"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pistolfly.com\/weblog\/wp-json\/wp\/v2\/tags?post=826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}