{"id":7707,"date":"2024-11-14T12:56:04","date_gmt":"2024-11-14T04:56:04","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7707\/"},"modified":"2024-11-14T12:56:04","modified_gmt":"2024-11-14T04:56:04","slug":"mysql-where-%e5%ad%90%e5%8f%a5%e5%a4%9a%e5%ad%97%e6%ae%b5%e7%ad%9b%e9%80%89%ef%bc%8c%e9%94%81%e8%a1%a8%e8%bf%98%e6%98%af%e9%94%81%e8%a1%8c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7707\/","title":{"rendered":"MySQL \u201cWHERE\u201d \u5b50\u53e5\u591a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173115703348100.jpg\" class=\"aligncenter\" title=\"MySQL \u201cWHERE\u201d \u5b50\u53e5\u591a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\uff1f\u63d2\u56fe\" alt=\"MySQL \u201cWHERE\u201d \u5b50\u53e5\u591a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u201cWHERE\u201d \u5b50\u53e5\u4e2d\u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\uff1f<\/strong><\/p>\n<p>\u5982\u9898\u6240\u8ff0\uff0cMySQL \u4e2d\u4f7f\u7528 \u201cWHERE\u201d \u5b50\u53e5\u65f6\uff0c\u7ecf\u5e38\u9700\u8981\u6307\u5b9a\u591a\u4e2a\u6761\u4ef6\u6765\u7b5b\u9009\u76ee\u6807\u884c\u3002\u90a3\u4e48\uff0c\u5f53\u8fd9\u4e9b\u6761\u4ef6\u6d89\u53ca\u591a\u4e2a\u5b57\u6bb5\u65f6\uff0cMySQL \u4f1a\u91c7\u7528\u54ea\u79cd\u9501\u673a\u5236\u5462\uff1f<\/p>\n<p>\u4ee5 \u201cUPDATE SET name = &#8216;xxx&#8217; WHERE id = 1 AND is_delete = 0\u201d \u8bed\u53e5\u4e3a\u4f8b\uff0c\u8be5\u8bed\u53e5\u8bd5\u56fe\u66f4\u65b0 id \u4e3a 1 \u4e14 is_delete \u4e3a 0 \u7684\u884c\u3002<\/p>\n<p>\u7531\u4e8e MySQL \u9ed8\u8ba4\u7684\u884c\u9501\u673a\u5236\uff0c\u5f53\u6267\u884c\u6b64\u8bed\u53e5\u65f6\uff0c\u53ea\u4f1a\u9501\u5b9a\u7b26\u5408\u6761\u4ef6\u7684\u884c\uff0c\u4e0d\u4f1a\u9501\u4f4f\u6574\u4e2a\u8868\u3002\u539f\u56e0\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u7b5b\u9009\u6761\u4ef6\u660e\u786e\u6307\u5b9a\u4e86 id \u548c is_delete \u4e24\u4e2a\u5b57\u6bb5\uff0cMySQL \u5c06\u6839\u636e\u8fd9\u4e9b\u5b57\u6bb5\u7684\u7d22\u5f15\u5feb\u901f\u5b9a\u4f4d\u76ee\u6807\u884c\u3002<\/li>\n<li>\u53ea\u6709\u7b26\u5408\u8fd9\u4e24\u4e2a\u6761\u4ef6\u7684\u884c\u624d\u4f1a\u88ab\u9501\u5b9a\uff0c\u4ece\u800c\u786e\u4fdd\u6570\u636e\u4e00\u81f4\u6027\uff0c\u540c\u65f6\u5141\u8bb8\u5176\u4ed6\u4f1a\u8bdd\u540c\u65f6\u8bbf\u95ee\u8868\u4e2d\u7684\u5176\u4ed6\u884c\u3002<\/li>\n<\/ul>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5c3d\u7ba1 \u201cWHERE\u201d \u5b50\u53e5\u4f7f\u7528\u4e86 id \u548c is_delete \u4e24\u4e2a\u5b57\u6bb5\u8fdb\u884c\u7b5b\u9009\uff0c\u4f46 MySQL \u4f1a\u9488\u5bf9\u7b26\u5408\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u884c\u9501\uff0c\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8868\u9501\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u201cWHERE\u201d \u5b50\u53e5\u591a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\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 \u201cWHERE\u201d \u5b50\u53e5\u4e2d\u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\uff1f \u5982\u9898\u6240\u8ff0\uff0cMySQL \u4e2d\u4f7f\u7528 \u201cWHERE\u201d \u5b50\u53e5\u65f6\uff0c\u7ecf\u5e38\u9700\u8981\u6307\u5b9a\u591a\u4e2a\u6761\u4ef6\u6765\u7b5b\u9009\u76ee\u6807\u884c\u3002\u90a3\u4e48\uff0c\u5f53\u8fd9\u4e9b\u6761\u4ef6\u6d89\u53ca\u591a\u4e2a\u5b57\u6bb5\u65f6\uff0cMySQL \u4f1a\u91c7\u7528\u54ea\u79cd\u9501\u673a\u5236\u5462\uff1f \u4ee5 \u201cUPDATE SET name = &#8216;xxx&#8217; WHERE id = 1 AND is_delete = 0\u201d \u8bed\u53e5\u4e3a\u4f8b\uff0c\u8be5\u8bed\u53e5\u8bd5\u56fe\u66f4\u65b0 id \u4e3a 1 \u4e14 is_delete \u4e3a 0 \u7684\u884c\u3002 \u7531\u4e8e MySQL \u9ed8\u8ba4\u7684\u884c\u9501\u673a\u5236\uff0c\u5f53\u6267\u884c\u6b64\u8bed\u53e5\u65f6\uff0c\u53ea\u4f1a\u9501\u5b9a\u7b26\u5408\u6761\u4ef6\u7684\u884c\uff0c\u4e0d\u4f1a\u9501\u4f4f\u6574\u4e2a\u8868\u3002\u539f\u56e0\u5982\u4e0b\uff1a \u7b5b\u9009\u6761\u4ef6\u660e\u786e\u6307\u5b9a\u4e86 id \u548c is_delete \u4e24\u4e2a\u5b57\u6bb5\uff0cMySQL \u5c06\u6839\u636e\u8fd9\u4e9b\u5b57\u6bb5\u7684\u7d22\u5f15\u5feb\u901f\u5b9a\u4f4d\u76ee\u6807\u884c\u3002 \u53ea\u6709\u7b26\u5408\u8fd9\u4e24\u4e2a\u6761\u4ef6\u7684\u884c\u624d\u4f1a\u88ab\u9501\u5b9a\uff0c\u4ece\u800c\u786e\u4fdd\u6570\u636e\u4e00\u81f4\u6027\uff0c\u540c\u65f6\u5141\u8bb8\u5176\u4ed6\u4f1a\u8bdd\u540c\u65f6\u8bbf\u95ee\u8868\u4e2d\u7684\u5176\u4ed6\u884c\u3002 \u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5c3d\u7ba1 \u201cWHERE\u201d \u5b50\u53e5\u4f7f\u7528\u4e86 id \u548c is_delete \u4e24\u4e2a\u5b57\u6bb5\u8fdb\u884c\u7b5b\u9009\uff0c\u4f46 MySQL \u4f1a\u9488\u5bf9\u7b26\u5408\u6761\u4ef6\u7684\u884c\u8fdb\u884c\u884c\u9501\uff0c\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u8868\u9501\u3002 \u4ee5\u4e0a\u5c31\u662fMySQL \u201cWHERE\u201d \u5b50\u53e5\u591a\u5b57\u6bb5\u7b5b\u9009\uff0c\u9501\u8868\u8fd8\u662f\u9501\u884c\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-7707","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7707","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=7707"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7707\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}