{"id":7697,"date":"2024-11-14T15:17:09","date_gmt":"2024-11-14T07:17:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7697\/"},"modified":"2024-11-14T15:17:09","modified_gmt":"2024-11-14T07:17:09","slug":"mysql-%e4%b8%ad-where-%e5%ad%90%e5%8f%a5%e5%a4%9a%e5%ad%97%e6%ae%b5%e6%9d%a1%e4%bb%b6%e4%b8%8b%ef%bc%8c%e9%94%81%e6%9c%ba%e5%88%b6%e6%98%af%e5%a6%82%e4%bd%95%e5%b7%a5%e4%bd%9c%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7697\/","title":{"rendered":"MySQL \u4e2d WHERE \u5b50\u53e5\u591a\u5b57\u6bb5\u6761\u4ef6\u4e0b\uff0c\u9501\u673a\u5236\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173114964335850.jpg\" class=\"aligncenter\" title=\"MySQL \u4e2d WHERE \u5b50\u53e5\u591a\u5b57\u6bb5\u6761\u4ef6\u4e0b\uff0c\u9501\u673a\u5236\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f\u63d2\u56fe\" alt=\"MySQL \u4e2d WHERE \u5b50\u53e5\u591a\u5b57\u6bb5\u6761\u4ef6\u4e0b\uff0c\u9501\u673a\u5236\u662f\u5982\u4f55\u5de5\u4f5c\u7684\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u4e2d WHERE \u5b50\u53e5\u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u5b57\u6bb5\u7684\u9501\u673a\u5236<\/strong><\/p>\n<p>\u5728 MySQL \u4e2d\uff0cUPDATE \u8bed\u53e5\u53ef\u4ee5\u901a\u8fc7 WHERE \u5b50\u53e5\u6307\u5b9a\u6761\u4ef6\u6765\u66f4\u65b0\u7279\u5b9a\u884c\u3002\u5f53 WHERE \u5b50\u53e5\u540c\u65f6\u4f7f\u7528\u4e86\u591a\u4e2a\u5b57\u6bb5\u65f6\uff0c\u6570\u636e\u5e93\u4f1a\u5bf9\u7b26\u5408\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u64cd\u4f5c\u3002<\/p>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c<strong>MySQL \u4f1a\u5bf9\u7b26\u5408 ID = 1 AND IS_DELETE = 0 \u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u884c\u64cd\u4f5c\u3002<\/strong>\u8fd9\u662f\u56e0\u4e3a MySQL \u4f1a\u5c06\u67e5\u8be2\u4e2d\u7684\u6bcf\u4e2a\u6761\u4ef6\u72ec\u7acb\u8003\u8651\uff0c\u5e76\u4ec5\u5bf9\u6ee1\u8db3\u6240\u6709\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u64cd\u4f5c\u3002<\/p>\n<p>\u5728\u9501\u884c\u65f6\uff0cMySQL \u4f1a\u83b7\u53d6\u5bf9\u5e94\u884c\u7684\u884c\u9501\uff0c\u4ee5\u9632\u6b62\u5176\u4ed6\u4f1a\u8bdd\u540c\u65f6\u66f4\u65b0\u6216\u4fee\u6539\u8fd9\u4e9b\u884c\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5f53\u4f7f\u7528 UPDATE \u8bed\u53e5\u540c\u65f6\u6307\u5b9a\u591a\u4e2a WHERE \u5b50\u53e5\u6761\u4ef6\u65f6\uff0cMySQL \u4f1a\u5bf9\u7b26\u5408\u6240\u6709\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u884c\u64cd\u4f5c\uff0c\u4ee5\u9632\u6b62\u5176\u4ed6\u4f1a\u8bdd\u5bf9\u8fd9\u4e9b\u884c\u4ea7\u751f\u5f71\u54cd\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u4e2d WHERE \u5b50\u53e5\u591a\u5b57\u6bb5\u6761\u4ef6\u4e0b\uff0c\u9501\u673a\u5236\u662f\u5982\u4f55\u5de5\u4f5c\u7684\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>MySQL \u4e2d WHERE \u5b50\u53e5\u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u5b57\u6bb5\u7684\u9501\u673a\u5236 \u5728 MySQL \u4e2d\uff0cUPDATE \u8bed\u53e5\u53ef\u4ee5\u901a\u8fc7 WHERE \u5b50\u53e5\u6307\u5b9a\u6761\u4ef6\u6765\u66f4\u65b0\u7279\u5b9a\u884c\u3002\u5f53 WHERE \u5b50\u53e5\u540c\u65f6\u4f7f\u7528\u4e86\u591a\u4e2a\u5b57\u6bb5\u65f6\uff0c\u6570\u636e\u5e93\u4f1a\u5bf9\u7b26\u5408\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u64cd\u4f5c\u3002 \u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cMySQL \u4f1a\u5bf9\u7b26\u5408 ID = 1 AND IS_DELETE = 0 \u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u884c\u64cd\u4f5c\u3002\u8fd9\u662f\u56e0\u4e3a MySQL \u4f1a\u5c06\u67e5\u8be2\u4e2d\u7684\u6bcf\u4e2a\u6761\u4ef6\u72ec\u7acb\u8003\u8651\uff0c\u5e76\u4ec5\u5bf9\u6ee1\u8db3\u6240\u6709\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u64cd\u4f5c\u3002 \u5728\u9501\u884c\u65f6\uff0cMySQL \u4f1a\u83b7\u53d6\u5bf9\u5e94\u884c\u7684\u884c\u9501\uff0c\u4ee5\u9632\u6b62\u5176\u4ed6\u4f1a\u8bdd\u540c\u65f6\u66f4\u65b0\u6216\u4fee\u6539\u8fd9\u4e9b\u884c\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u6570\u636e\u7684\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u3002 \u56e0\u6b64\uff0c\u5f53\u4f7f\u7528 UPDATE \u8bed\u53e5\u540c\u65f6\u6307\u5b9a\u591a\u4e2a WHERE \u5b50\u53e5\u6761\u4ef6\u65f6\uff0cMySQL \u4f1a\u5bf9\u7b26\u5408\u6240\u6709\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u9501\u884c\u64cd\u4f5c\uff0c\u4ee5\u9632\u6b62\u5176\u4ed6\u4f1a\u8bdd\u5bf9\u8fd9\u4e9b\u884c\u4ea7\u751f\u5f71\u54cd\u3002 \u4ee5\u4e0a\u5c31\u662fMySQL \u4e2d WHERE \u5b50\u53e5\u591a\u5b57\u6bb5\u6761\u4ef6\u4e0b\uff0c\u9501\u673a\u5236\u662f\u5982\u4f55\u5de5\u4f5c\u7684\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-7697","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7697","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=7697"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7697\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}