{"id":7043,"date":"2024-11-14T09:39:27","date_gmt":"2024-11-14T01:39:27","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7043\/"},"modified":"2024-11-14T09:39:27","modified_gmt":"2024-11-14T01:39:27","slug":"sql-%e4%b8%ad%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-update-ignore-%e8%af%ad%e6%b3%95%e6%9d%a5%e5%bf%bd%e7%95%a5%e5%86%b2%e7%aa%81%e7%9a%84%e6%9b%b4%e6%96%b0%e6%93%8d%e4%bd%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7043\/","title":{"rendered":"SQL \u4e2d\u5982\u4f55\u4f7f\u7528 UPDATE IGNORE \u8bed\u6cd5\u6765\u5ffd\u7565\u51b2\u7a81\u7684\u66f4\u65b0\u64cd\u4f5c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173034785138950.jpg\" class=\"aligncenter\" title=\"SQL \u4e2d\u5982\u4f55\u4f7f\u7528 UPDATE IGNORE \u8bed\u6cd5\u6765\u5ffd\u7565\u51b2\u7a81\u7684\u66f4\u65b0\u64cd\u4f5c\uff1f\u63d2\u56fe\" alt=\"SQL \u4e2d\u5982\u4f55\u4f7f\u7528 UPDATE IGNORE \u8bed\u6cd5\u6765\u5ffd\u7565\u51b2\u7a81\u7684\u66f4\u65b0\u64cd\u4f5c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u907f\u514d\u66f4\u65b0\u51b2\u7a81\uff1asql \u4e2d\u7684 update ignore \u8bed\u6cd5<\/strong><\/p>\n<p>\u5728 sql \u4e2d\u6267\u884c\u66f4\u65b0\u64cd\u4f5c\u65f6\uff0c\u6709\u65f6\u6211\u4eec\u5e0c\u671b\u5ffd\u7565\u5bfc\u81f4\u9519\u8bef\u7684\u66f4\u65b0\uff0c\u800c\u53ea\u5bf9\u6ca1\u6709\u51b2\u7a81\u7684\u6570\u636e\u8fdb\u884c\u66f4\u65b0\u3002\u6b64\u65f6\uff0cupdate ignore \u8bed\u6cd5\u53ef\u4ee5\u53d1\u6325\u4f5c\u7528\u3002<\/p>\n<p>update ignore \u8bed\u6cd5\u4e0e update \u8bed\u6cd5\u7c7b\u4f3c\uff0c\u4f46\u901a\u8fc7\u6dfb\u52a0 ignore \u5173\u952e\u5b57\uff0c\u5b83\u5141\u8bb8\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e0b\u9632\u6b62\u9519\u8bef\u4e2d\u6b62\u66f4\u65b0\uff1a<\/p>\n<ul>\n<li>\u5bf9\u4e8e\u4e0e\u552f\u4e00\u952e\u51b2\u7a81\u7684\u884c\uff0c\u4e0d\u4f1a\u6267\u884c\u66f4\u65b0\u3002<\/li>\n<li>\u5f53\u66f4\u65b0\u4f1a\u5bfc\u81f4\u6570\u636e\u8f6c\u6362\u9519\u8bef\u65f6\uff0c\u4f1a\u5c06\u884c\u66f4\u65b0\u4e3a\u6700\u63a5\u8fd1\u7684\u6709\u6548\u503c\u3002<\/li>\n<\/ul>\n<p>update ignore \u8bed\u6cd5\u7684\u5b8c\u6574\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>update [low_priority] [ignore] table_reference\n    set assignment_list\n    [where where_condition]\n    [order by ...]\n    [limit row_count]<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p><strong>\u793a\u4f8b\uff1a<\/strong><\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a people \u8868\uff0c\u5176\u4e2d name \u5217\u662f\u552f\u4e00\u952e\u3002\u5982\u679c\u6211\u4eec\u5c1d\u8bd5\u4f7f\u7528\u4ee5\u4e0b\u66f4\u65b0\u8bed\u53e5\u63d2\u5165\u4e00\u4e2a\u91cd\u590d\u7684\u540d\u79f0\uff1a<\/p>\n<pre>update people\nset name = 'john doe'\nwhere id = 1;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5982\u679c\u6ca1\u6709 ignore \u5173\u952e\u5b57\uff0c\u6b64\u8bed\u53e5\u5c06\u5931\u8d25\u5e76\u663e\u793a\u9519\u8bef\u3002\u4f46\u662f\uff0c\u5982\u679c\u60a8\u6539\u7528\uff1a<\/p>\n<pre>UPDATE IGNORE people\nSET name = 'John Doe'\nWHERE id = 1;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u66f4\u65b0\u5c06\u6210\u529f\u6267\u884c\uff0c\u800c\u5bf9\u4e8e\u91cd\u590d\u7684\u540d\u79f0\u884c\uff0c\u66f4\u65b0\u5c06\u88ab\u5ffd\u7565\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fSQL \u4e2d\u5982\u4f55\u4f7f\u7528 UPDATE IGNORE \u8bed\u6cd5\u6765\u5ffd\u7565\u51b2\u7a81\u7684\u66f4\u65b0\u64cd\u4f5c\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>\u907f\u514d\u66f4\u65b0\u51b2\u7a81\uff1asql \u4e2d\u7684 update ignore \u8bed\u6cd5 \u5728 sql \u4e2d\u6267\u884c\u66f4\u65b0\u64cd\u4f5c\u65f6\uff0c\u6709\u65f6\u6211\u4eec\u5e0c\u671b\u5ffd\u7565\u5bfc\u81f4\u9519\u8bef\u7684\u66f4\u65b0\uff0c\u800c\u53ea\u5bf9\u6ca1\u6709\u51b2\u7a81\u7684\u6570\u636e\u8fdb\u884c\u66f4\u65b0\u3002\u6b64\u65f6\uff0cupdate ignore \u8bed\u6cd5\u53ef\u4ee5\u53d1\u6325\u4f5c\u7528\u3002 update ignore \u8bed\u6cd5\u4e0e update \u8bed\u6cd5\u7c7b\u4f3c\uff0c\u4f46\u901a\u8fc7\u6dfb\u52a0 ignore \u5173\u952e\u5b57\uff0c\u5b83\u5141\u8bb8\u5728\u4ee5\u4e0b\u60c5\u51b5\u4e0b\u9632\u6b62\u9519\u8bef\u4e2d\u6b62\u66f4\u65b0\uff1a \u5bf9\u4e8e\u4e0e\u552f\u4e00\u952e\u51b2\u7a81\u7684\u884c\uff0c\u4e0d\u4f1a\u6267\u884c\u66f4\u65b0\u3002 \u5f53\u66f4\u65b0\u4f1a\u5bfc\u81f4\u6570\u636e\u8f6c\u6362\u9519\u8bef\u65f6\uff0c\u4f1a\u5c06\u884c\u66f4\u65b0\u4e3a\u6700\u63a5\u8fd1\u7684\u6709\u6548\u503c\u3002 update ignore \u8bed\u6cd5\u7684\u5b8c\u6574\u8bed\u6cd5\u5982\u4e0b\uff1a update [low_priority] [ignore] table_reference set assignment_list [where where_condition] [order by &#8230;] [limit row_count] \u767b\u5f55\u540e\u590d\u5236 \u793a\u4f8b\uff1a \u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a people \u8868\uff0c\u5176\u4e2d name \u5217\u662f\u552f\u4e00\u952e\u3002\u5982\u679c\u6211\u4eec\u5c1d\u8bd5\u4f7f\u7528\u4ee5\u4e0b\u66f4\u65b0\u8bed\u53e5\u63d2\u5165\u4e00\u4e2a\u91cd\u590d\u7684\u540d\u79f0\uff1a update people set name = &#8216;john doe&#8217; where id = 1; \u767b\u5f55\u540e\u590d\u5236 \u5982\u679c\u6ca1\u6709 [&hellip;]<\/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-7043","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7043","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=7043"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7043\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}