{"id":522,"date":"2010-10-01T03:34:47","date_gmt":"2010-10-01T03:34:47","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=522"},"modified":"2010-10-01T03:35:28","modified_gmt":"2010-10-01T03:35:28","slug":"asdfsdf","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2010\/10\/01\/asdfsdf\/","title":{"rendered":"MySql \u4e0d\u652f\u6301\u5b50\u67e5\u8be2\u7684\u53d8\u901a\u65b9\u6cd5"},"content":{"rendered":"<pre lang=\"tsql\">\r\n\u5230\u76ee\u524d\u4e3a\u6b62\uff0cMySQL \u8fd8\u4e0d\u80fd\u652f\u6301\u8fd9\u6837\u7684\u64cd\u4f5c\uff0c\u5b50\u67e5\u8be2\u7684 FROM \u5b57\u53e5\u548c\u66f4\u65b0\/\u5220\u9664\u5bf9\u8c61\u4e0d\u80fd\u4f7f\u7528\u540c\u4e00\u5f20\u8868\u3002\r\n\r\nmysql> DELETE FROM tab1 WHERE col1 = ( SELECT MAX( col1 ) FROM tab1 );ERROR 1093 (HY000): You can't specify target table 'tab1' for update in FROM clause\r\n\r\n\u9488\u5bf9\u201c\u540c\u4e00\u5f20\u8868\u201d\u8fd9\u4e2a\u9650\u5236\uff0c\u6487\u5f00\u6548\u7387\u4e0d\u8c08\uff0c\u591a\u6570\u60c5\u51b5\u4e0b\u90fd\u53ef\u4ee5\u901a\u8fc7\u4e34\u65f6\u8868\u6765\u53d8\u901a\u89e3\u51b3\uff0c\u50cf\u8fd9\u6837\r\n\r\nDELETE FROM tab1WHERE col1 = (  SELECT MAX( col1 )  FROM (    SELECT * FROM tab1  ) AS t);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0cMySQL \u8fd8\u4e0d\u80fd\u652f\u6301\u8fd9\u6837\u7684\u64cd\u4f5c\uff0c\u5b50\u67e5\u8be2\u7684 FROM \u5b57\u53e5\u548c\u66f4\u65b0\/\u5220\u9664\u5bf9\u8c61\u4e0d\u80fd\u4f7f\u7528\u540c\u4e00\u5f20\u8868\u3002 my [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-522","post","type-post","status-publish","format-standard","hentry","category-mysql"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}