{"id":7759,"date":"2024-11-14T13:44:11","date_gmt":"2024-11-14T05:44:11","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7759\/"},"modified":"2024-11-14T13:44:11","modified_gmt":"2024-11-14T05:44:11","slug":"mysql-%e4%b8%ad-is-true-%e5%92%8c-true-%e4%b8%ba%e4%bb%80%e4%b9%88%e4%bc%9a%e8%bf%94%e5%9b%9e%e4%b8%8d%e5%90%8c%e7%9a%84%e7%bb%93%e6%9e%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7759\/","title":{"rendered":"MySQL \u4e2d IS TRUE \u548c = TRUE \u4e3a\u4ec0\u4e48\u4f1a\u8fd4\u56de\u4e0d\u540c\u7684\u7ed3\u679c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173122299372715.jpg\" class=\"aligncenter\" title=\"MySQL \u4e2d IS TRUE \u548c = TRUE \u4e3a\u4ec0\u4e48\u4f1a\u8fd4\u56de\u4e0d\u540c\u7684\u7ed3\u679c\uff1f\u63d2\u56fe\" alt=\"MySQL \u4e2d IS TRUE \u548c = TRUE \u4e3a\u4ec0\u4e48\u4f1a\u8fd4\u56de\u4e0d\u540c\u7684\u7ed3\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong> \u4e2d is true \u548c = true \u7ed3\u679c\u4e0d\u540c\u7684\u539f\u56e0<\/strong><\/p>\n<p>\u5728 mysql \u4e2d\uff0cis true \u548c = true \u8fd4\u56de\u4e0d\u540c\u7684\u7ed3\u679c\u3002\u8fd9\u80cc\u540e\u7684\u539f\u56e0\u5728\u4e8e\u8fd0\u7b97\u7b26\u7684\u4e0d\u540c\u3002<\/p>\n<p><strong>= \u8fd0\u7b97\u7b26<\/strong><\/p>\n<p>= \u8fd0\u7b97\u7b26\u8fdb\u884c\u7684\u662f\u6570\u503c\u6bd4\u8f83\u3002\u5728 mysql \u4e2d\uff0ctrue \u6620\u5c04\u4e3a\u6574\u578b\u503c 1\u3002\u56e0\u6b64\uff0cis_deleted = true \u5c06\u6bd4\u8f83 is_deleted \u5217\u7684\u503c\u548c 1\u3002<\/p>\n<p><strong>is true \u8fd0\u7b97\u7b26<\/strong><\/p>\n<p>\u53e6\u4e00\u65b9\u9762\uff0cis true \u8fd0\u7b97\u7b26\u6267\u884c\u771f\u5047\u5224\u65ad\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4efb\u4f55\u975e\u96f6\u503c\u90fd\u5c06\u88ab\u89c6\u4e3a\u771f\uff0c\u5305\u62ec 1\u3001127 \u548c 255\u3002<\/p>\n<p><strong>\u793a\u4f8b<\/strong><\/p>\n<pre>select * from `user` where is_deleted is true;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6b64\u67e5\u8be2\u5c06\u8fd4\u56de\u6240\u6709 is_deleted \u5217\u4e0d\u4e3a\u96f6\u7684\u884c\u3002<\/p>\n<pre>SELECT * FROM `user` WHERE is_deleted = TRUE;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u6b64\u67e5\u8be2\u4ec5\u8fd4\u56de is_deleted \u5217\u503c\u4e3a 1 \u7684\u884c\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u7531\u4e8e is_deleted \u5217\u7684\u503c\u4e3a 127\uff0cis true \u67e5\u8be2\u5c06\u8fd4\u56de\u6240\u6709\u884c\uff0c\u800c = true \u67e5\u8be2\u5c06\u8fd4\u56de\u7a7a\u7ed3\u679c\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u4e2d IS TRUE \u548c = TRUE \u4f1a\u8fd4\u56de\u4e0d\u540c\u7684\u7ed3\u679c\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>\u4e2d is true \u548c = true \u7ed3\u679c\u4e0d\u540c\u7684\u539f\u56e0 \u5728 mysql \u4e2d\uff0cis true \u548c = true \u8fd4\u56de\u4e0d\u540c\u7684\u7ed3\u679c\u3002\u8fd9\u80cc\u540e\u7684\u539f\u56e0\u5728\u4e8e\u8fd0\u7b97\u7b26\u7684\u4e0d\u540c\u3002 = \u8fd0\u7b97\u7b26 = \u8fd0\u7b97\u7b26\u8fdb\u884c\u7684\u662f\u6570\u503c\u6bd4\u8f83\u3002\u5728 mysql \u4e2d\uff0ctrue \u6620\u5c04\u4e3a\u6574\u578b\u503c 1\u3002\u56e0\u6b64\uff0cis_deleted = true \u5c06\u6bd4\u8f83 is_deleted \u5217\u7684\u503c\u548c 1\u3002 is true \u8fd0\u7b97\u7b26 \u53e6\u4e00\u65b9\u9762\uff0cis true \u8fd0\u7b97\u7b26\u6267\u884c\u771f\u5047\u5224\u65ad\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4efb\u4f55\u975e\u96f6\u503c\u90fd\u5c06\u88ab\u89c6\u4e3a\u771f\uff0c\u5305\u62ec 1\u3001127 \u548c 255\u3002 \u793a\u4f8b select * from `user` where is_deleted is true; \u767b\u5f55\u540e\u590d\u5236 \u6b64\u67e5\u8be2\u5c06\u8fd4\u56de\u6240\u6709 is_deleted \u5217\u4e0d\u4e3a\u96f6\u7684\u884c\u3002 SELECT * FROM `user` [&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-7759","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7759","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=7759"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7759\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}