{"id":6618,"date":"2021-06-28T10:31:12","date_gmt":"2021-06-28T02:31:12","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=6618"},"modified":"2021-06-28T10:33:17","modified_gmt":"2021-06-28T02:33:17","slug":"gbase-8a%e6%9f%a5%e8%af%a2%e4%bb%bb%e6%84%8f%e4%b8%80%e5%88%97%e4%b8%banull%e6%88%96%e6%9f%90%e4%b8%aa%e5%80%bc%e7%9a%84%e6%95%b0%e6%8d%ae%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/6618","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u7a7a\u503c\u67e5\u8be2\uff0c\u4efb\u610f\u4e00\u5217\u4e3a\u7a7aNULL\u6216\u67d0\u4e2a\u503c\u7684\u6570\u636e\u884c\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u4eca\u5929\u624d\u53d1\u73b0\u4e86in\u7684\u4e00\u4e2a\u7528\u6cd5\uff0c\u5728GBase 8a\u91cc\u505a\u4e86\u5b9e\u9a8c\uff0c\u53ef\u4ee5\u8ba9\u4e00\u4e2a\u503cin\u4e00\u7ec4\u5217\u6765\u5b9e\u73b0\uff1a\u4efb\u610f\u4e00\u5217\u7b49\u4e8e\u503c\u5c31\u8fd4\u56de\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Directory Navigation<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2b165e45273\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2b165e45273\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.gbase8.cn\/en\/6618\/#%E9%9C%80%E6%B1%82\" >\u9700\u6c42<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.gbase8.cn\/en\/6618\/#%E6%99%AE%E9%80%9A%E5%AE%9E%E7%8E%B0_IS_NULL\" >\u666e\u901a\u5b9e\u73b0 IS NULL<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.gbase8.cn\/en\/6618\/#IN%E7%9A%84%E5%86%99%E6%B3%95\" >IN\u7684\u5199\u6cd5<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%9C%80%E6%B1%82\"><\/span>\u9700\u6c42<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u67e5\u8be2\u4efb\u610f\u4e00\u5217\u4e3aNULL \uff0c\u6216\u8005\u4e3a\u4e00\u4e2a\u6307\u5b9a\u5b57\u7b26\u4e32\uff0c\u6bd4\u5982'&lt;ERROR&gt;'\u7684\u6570\u636e\u884c\u3002<\/p>\n\n\n\n<p>\u6211\u8fd9\u91cc\u75282\u5217\u505a\u4e2a\u793a\u4f8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from t1;\n+------+-------+\n| id   | name  |\n+------+-------+\n| NULL | First |\n|  222 | NULL  |\n|  333 | Third |\n+------+-------+\n3 rows in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%99%AE%E9%80%9A%E5%AE%9E%E7%8E%B0_IS_NULL\"><\/span>\u666e\u901a\u5b9e\u73b0 IS NULL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u7528\u591a\u4e2aIS NULL\u7684OR\u6761\u4ef6\u6765\u5b9e\u73b0\uff0c\u770b\u4e0a\u53bb\u8bed\u6cd5\u660e\u786e\uff0c\u5f88\u5bb9\u6613\u7406\u89e3\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from t1 where id is null or name is null;\n+------+-------+\n| id   | name  |\n+------+-------+\n| NULL | First |\n|  222 | NULL  |\n+------+-------+\n2 rows in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"IN%E7%9A%84%E5%86%99%E6%B3%95\"><\/span>IN\u7684\u5199\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6570\u503c IN (\u5b57\u6bb5\u5217\u8868) \u8fd9\u4e2a\u5199\u6cd5\uff0c\u6211\u8fd8\u662f\u7b2c\u4e00\u6b21\u7528\u3002\u6ce8\u610fNULL\u4e0d\u7b49\u4e8e\u4efb\u4f55\u503c\uff0c\u5982\u4e0b\u5df2\u7ecf\u5c06NULL\u8f6c\u6210\u4e86\u7a7a\u5b57\u7b26\u4e32''\u6765\u64cd\u4f5c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from t1 where '' in(nvl(id,''),nvl(name,''));\n+------+-------+\n| id   | name  |\n+------+-------+\n| NULL | First |\n|  222 | NULL  |\n+------+-------+\n2 rows in set (Elapsed: 00:00:00.01)\n<\/code><\/pre>\n\n\n\n<p>\u540c\u6837\u7684\uff0c\u5176\u5b83\u503c\u4e5f\u662f\u53ef\u4ee5\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from t1 where '222' in(id,name);\n+------+------+\n| id   | name |\n+------+------+\n|  222 | NULL |\n+------+------+\n1 row in set (Elapsed: 00:00:00.00)\n\ngbase&gt; select * from t1 where 'First' in(id,name);\n+------+-------+\n| id   | name  |\n+------+-------+\n| NULL | First |\n+------+-------+\n1 row in set (Elapsed: 00:00:00.01)\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u624d\u53d1\u73b0\u4e86in\u7684\u4e00\u4e2a\u7528\u6cd5\uff0c\u5728GBase 8a\u91cc\u505a\u4e86\u5b9e\u9a8c\uff0c\u53ef\u4ee5\u8ba9\u4e00\u4e2a\u503cin\u4e00\u7ec4\u5217\u6765\u5b9e\u73b0\uff1a\u4efb\u610f\u4e00\u5217\u7b49\u4e8e\u503c\u5c31\u8fd4\u56de\u7684\u65b9\u6cd5\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6618","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=6618"}],"version-history":[{"count":5,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6618\/revisions"}],"predecessor-version":[{"id":6623,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/6618\/revisions\/6623"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=6618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=6618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=6618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}