{"id":27246,"date":"2024-11-24T11:28:36","date_gmt":"2024-11-24T03:28:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/27246\/"},"modified":"2024-11-24T11:28:36","modified_gmt":"2024-11-24T03:28:36","slug":"mysql-%e4%b8%ad-is-true-%e5%92%8c-true-%e7%9a%84%e7%bb%93%e6%9e%9c%e4%b8%ba%e4%bd%95%e4%b8%8d%e5%90%8c%ef%bc%9f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27246\/","title":{"rendered":"MySQL \u4e2d IS TRUE \u548c =True \u7684\u7ed3\u679c\u4e3a\u4f55\u4e0d\u540c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173121715276147.jpg\" class=\"aligncenter\" title=\"MySQL \u4e2d IS TRUE \u548c =True \u7684\u7ed3\u679c\u4e3a\u4f55\u4e0d\u540c\uff1f\u63d2\u56fe\" alt=\"MySQL \u4e2d IS TRUE \u548c =True \u7684\u7ed3\u679c\u4e3a\u4f55\u4e0d\u540c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>MySQL \u4e2d IS TRUE \u548c =True \u7ed3\u679c\u5dee\u5f02\u7684\u539f\u56e0<\/strong><\/p>\n<p>\u5f53\u6bd4\u8f83 MySQL \u4e2d\u7684\u5e03\u5c14\u503c\u65f6\uff0c\u53ef\u4ee5\u53d1\u73b0 IS TRUE \u548c =True \u8fd4\u56de\u7684\u7ed3\u679c\u4e0d\u540c\u3002\u4f1a\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5\u5462\uff1f<\/p>\n<p>\u5bf9\u4e8e IS TRUE \u6bd4\u8f83\uff0c\u5b83\u5c06\u975e\u96f6\u503c\u89e3\u91ca\u4e3a\u771f\uff0c\u800c\u5bf9\u4e8e =True \u6bd4\u8f83\uff0c\u5b83\u68c0\u67e5\u503c\u662f\u5426\u4e25\u683c\u7b49\u4e8e 1\u3002\u5728 MySQL \u4e2d\uff0cTRUE \u88ab\u8f6c\u6362\u4e3aTINYINT(1)\u7c7b\u578b\uff0c\u5176\u4e2d 1 \u8868\u793a\u771f\uff0c0 \u8868\u793a\u5047\u3002<\/p>\n<p>\u6240\u4ee5\uff0c\u5f53\u4f7f\u7528 =True \u65f6\uff0c\u5b83\u6b63\u5728\u68c0\u67e5 TINYINT(1) \u503c\u662f\u5426\u7b49\u4e8e 1\u3002\u7136\u800c\uff0c\u5f53\u4f7f\u7528 IS TRUE \u65f6\uff0c\u5b83\u6b63\u5728\u68c0\u67e5\u8be5\u503c\u662f\u5426\u975e\u96f6\u3002<\/p>\n<p>\u5728\u6b64\u793a\u4f8b\u4e2d\uff0cTINYINT(1) \u5217 is_deleted \u4e2d\u7684\u503c\u4e3a 127\uff0c\u800c\u975e 1\u3002\u56e0\u6b64\uff0c=True \u6bd4\u8f83\u5931\u8d25\uff0c\u800c IS TRUE \u6bd4\u8f83\u6210\u529f\u3002<\/p>\n<p><strong>\u5dee\u5f02\u7684\u610f\u4e49<\/strong><\/p>\n<p>\u7406\u89e3\u8fd9\u4e00\u5dee\u5f02\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5f71\u54cd SQL \u67e5\u8be2\u7684\u7ed3\u679c\u3002\u5f53\u9700\u8981\u68c0\u67e5\u503c\u662f\u5426\u4e3a\u771f\u65f6\uff08\u7c7b\u4f3c\u4e8e Java \u4e2d\u7684 Boolean \u503c\uff09\uff0c\u8bf7\u4f7f\u7528 IS TRUE\u3002\u5f53\u9700\u8981\u68c0\u67e5\u503c\u662f\u5426\u7b49\u4e8e\u7279\u5b9a\u7684\u5e03\u5c14\u503c\u65f6\uff08\u4f8b\u5982 TRUE \u6216 FALSE\uff09\uff0c\u5219\u4f7f\u7528 =True \u6216 =FALSE\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fMySQL \u4e2d IS TRUE \u548c =True \u7684\u7ed3\u679c\u4e3a\u4f55\u4e0d\u540c\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL \u4e2d IS TRUE \u548c =True \u7ed3\u679c\u5dee\u5f02\u7684\u539f\u56e0 \u5f53\u6bd4\u8f83 MySQL \u4e2d\u7684\u5e03\u5c14\u503c\u65f6\uff0c\u53ef\u4ee5\u53d1\u73b0 IS TRUE \u548c =True \u8fd4\u56de\u7684\u7ed3\u679c\u4e0d\u540c\u3002\u4f1a\u51fa\u73b0\u8fd9\u79cd\u60c5\u51b5\u5462\uff1f \u5bf9\u4e8e IS TRUE \u6bd4\u8f83\uff0c\u5b83\u5c06\u975e\u96f6\u503c\u89e3\u91ca\u4e3a\u771f\uff0c\u800c\u5bf9\u4e8e =True \u6bd4\u8f83\uff0c\u5b83\u68c0\u67e5\u503c\u662f\u5426\u4e25\u683c\u7b49\u4e8e 1\u3002\u5728 MySQL \u4e2d\uff0cTRUE \u88ab\u8f6c\u6362\u4e3aTINYINT(1)\u7c7b\u578b\uff0c\u5176\u4e2d 1 \u8868\u793a\u771f\uff0c0 \u8868\u793a\u5047\u3002 \u6240\u4ee5\uff0c\u5f53\u4f7f\u7528 =True \u65f6\uff0c\u5b83\u6b63\u5728\u68c0\u67e5 TINYINT(1) \u503c\u662f\u5426\u7b49\u4e8e 1\u3002\u7136\u800c\uff0c\u5f53\u4f7f\u7528 IS TRUE \u65f6\uff0c\u5b83\u6b63\u5728\u68c0\u67e5\u8be5\u503c\u662f\u5426\u975e\u96f6\u3002 \u5728\u6b64\u793a\u4f8b\u4e2d\uff0cTINYINT(1) \u5217 is_deleted \u4e2d\u7684\u503c\u4e3a 127\uff0c\u800c\u975e 1\u3002\u56e0\u6b64\uff0c=True \u6bd4\u8f83\u5931\u8d25\uff0c\u800c IS TRUE \u6bd4\u8f83\u6210\u529f\u3002 \u5dee\u5f02\u7684\u610f\u4e49 \u7406\u89e3\u8fd9\u4e00\u5dee\u5f02\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5f71\u54cd SQL \u67e5\u8be2\u7684\u7ed3\u679c\u3002\u5f53\u9700\u8981\u68c0\u67e5\u503c\u662f\u5426\u4e3a\u771f\u65f6\uff08\u7c7b\u4f3c\u4e8e Java \u4e2d\u7684 Boolean \u503c\uff09\uff0c\u8bf7\u4f7f\u7528 [&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-27246","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27246","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=27246"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27246\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}