{"id":26846,"date":"2024-11-24T10:30:09","date_gmt":"2024-11-24T02:30:09","guid":{"rendered":"https:\/\/fwq.ai\/blog\/26846\/"},"modified":"2024-11-24T10:30:09","modified_gmt":"2024-11-24T02:30:09","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88-mysql-%e7%9a%84-where-%e5%ad%90%e5%8f%a5%e4%b8%ad%e5%b8%83%e5%b0%94%e5%80%bc%e5%ad%97%e6%ae%b5%e6%af%94%e8%be%83%e8%a6%81%e7%94%a8%e5%ad%97%e7%ac%a6%e4%b8%b2%e8%80%8c-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/26846\/","title":{"rendered":"\u4e3a\u4ec0\u4e48 MySQL \u7684 WHERE \u5b50\u53e5\u4e2d\u5e03\u5c14\u503c\u5b57\u6bb5\u6bd4\u8f83\u8981\u7528\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u6570\u5b57\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173111223392338.jpg\" class=\"aligncenter\" title=\"\u4e3a\u4ec0\u4e48 MySQL \u7684 WHERE \u5b50\u53e5\u4e2d\u5e03\u5c14\u503c\u5b57\u6bb5\u6bd4\u8f83\u8981\u7528\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u6570\u5b57\uff1f\u63d2\u56fe\" alt=\"\u4e3a\u4ec0\u4e48 MySQL \u7684 WHERE \u5b50\u53e5\u4e2d\u5e03\u5c14\u503c\u5b57\u6bb5\u6bd4\u8f83\u8981\u7528\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u6570\u5b57\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>  \u7684 where \u4e4b\u95f4\u65e0\u6cd5\u4f7f\u7528 = \u68c0\u7d22\u5e03\u5c14\u503c\uff1f<\/strong><\/p>\n<p>\u5728 mysql \u4e2d\uff0cwhere \u5b50\u53e5\u4e2d\u5e03\u5c14\u503c\u5b57\u6bb5\u7684\u6bd4\u8f83\u5fc5\u987b\u4f7f\u7528\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u6570\u5b57\u3002\u8fd9\u662f\u56e0\u4e3a enum \u503c\uff08\u5e03\u5c14\u503c\u7c7b\u578b\u4f5c\u4e3a enum \u503c\u5b58\u50a8\uff09\u7684\u7d22\u5f15\u662f\u4ece 1 \u5f00\u59cb\u7684\uff0c\u800c\u4e0d\u662f\u4ece 0 \u5f00\u59cb\u7684\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5728\u60a8\u63d0\u4f9b\u7684\u8868\u7ed3\u6784\u4e2d\uff0cis_svddb_match \u5b57\u6bb5\u662f\u4f7f\u7528 &#8216;true&#8217;\uff081\uff09\u548c &#8216;false&#8217;\uff080\uff09\u503c\u7684 enum \u7c7b\u578b\uff1a<\/p>\n<pre>create table `tmp_rt57517_20230407` (\n  `video_id` int(10) unsigned not null,\n  `key_id` varchar(64) not null comment 'key id from tracking website',\n  `trackingwebsite_id` smallint(5) unsigned not null comment 'tracking website id',\n  `is_svddb` enum('true','false') not null default 'true' comment 'filter meta by release date',\n  `is_svddb_match` enum('true','false') not null default 'true' comment 'filter meta by release date',\n  `match_count` int(11) default null comment '\u5339\u914d\u5230\u51e0\u4e2a\u6bcd\u672c',\n  primary key (`video_id`)\n) engine=innodb default charset=latin1<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u5f53\u60a8\u4f7f\u7528 where \u5b50\u53e5\u6bd4\u8f83\u5e03\u5c14\u503c\u5b57\u6bb5\u65f6\uff0c\u5fc5\u987b\u4f7f\u7528\u76f8\u5e94\u7684\u5b57\u7b26\u4e32\u503c\u3002\u56e0\u6b64\uff0c\u8981\u68c0\u7d22\u6240\u6709 is_svddb_match \u503c\u4e3a false \u7684\u884c\uff0c\u60a8\u9700\u8981\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8be2\uff1a<\/p>\n<pre>SELECT * FROM `tmp_rt57517_20230407` WHERE `is_svddb_match` = 'false';<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u4f7f\u7528\u6570\u5b57\u503c\uff08\u4f8b\u5982 where is_svddb_match = 0\uff09\u5c06\u4e0d\u4f1a\u8fd4\u56de\u4efb\u4f55\u7ed3\u679c\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f MySQL \u7684 WHERE \u5b50\u53e5\u4e2d\u5e03\u5c14\u503c\u5b57\u6bb5\u6bd4\u8f83\u8981\u7528\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u6570\u5b57\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>\u7684 where \u4e4b\u95f4\u65e0\u6cd5\u4f7f\u7528 = \u68c0\u7d22\u5e03\u5c14\u503c\uff1f \u5728 mysql \u4e2d\uff0cwhere \u5b50\u53e5\u4e2d\u5e03\u5c14\u503c\u5b57\u6bb5\u7684\u6bd4\u8f83\u5fc5\u987b\u4f7f\u7528\u5b57\u7b26\u4e32\u800c\u4e0d\u662f\u6570\u5b57\u3002\u8fd9\u662f\u56e0\u4e3a enum \u503c\uff08\u5e03\u5c14\u503c\u7c7b\u578b\u4f5c\u4e3a enum \u503c\u5b58\u50a8\uff09\u7684\u7d22\u5f15\u662f\u4ece 1 \u5f00\u59cb\u7684\uff0c\u800c\u4e0d\u662f\u4ece 0 \u5f00\u59cb\u7684\u3002 \u4f8b\u5982\uff0c\u5728\u60a8\u63d0\u4f9b\u7684\u8868\u7ed3\u6784\u4e2d\uff0cis_svddb_match \u5b57\u6bb5\u662f\u4f7f\u7528 &#8216;true&#8217;\uff081\uff09\u548c &#8216;false&#8217;\uff080\uff09\u503c\u7684 enum \u7c7b\u578b\uff1a create table `tmp_rt57517_20230407` ( `video_id` int(10) unsigned not null, `key_id` varchar(64) not null comment &#8216;key id from tracking website&#8217;, `trackingwebsite_id` smallint(5) unsigned not null comment &#8216;tracking website id&#8217;, `is_svddb` enum(&#8216;true&#8217;,&#8217;false&#8217;) not null [&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-26846","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26846","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=26846"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/26846\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=26846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=26846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=26846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}