{"id":2975,"date":"2021-01-06T16:54:41","date_gmt":"2021-01-06T08:54:41","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=2975"},"modified":"2021-01-06T16:55:13","modified_gmt":"2021-01-06T08:55:13","slug":"gbase-8a%e6%9f%a5%e8%af%a2%e7%a9%ba%e5%80%bc%e8%ae%b0%e5%bd%95%ef%bc%8cnull%e5%80%bc%e7%ad%89%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/2975","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u67e5\u8be2\u7a7a\u503c\u8bb0\u5f55\uff0cnull\u503c\u7b49\u7684\u65b9\u6cd5"},"content":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u5728GBase 8a\u6570\u636e\u5e93\u4e2d\uff0c\u5982\u4f55\u67e5\u8be2\u7a7a\u503c\u3002\u8fd9\u91cc\u7a7a\u503c\u67092\u4e2a\u63cf\u8ff0\uff1a1\u3001\u957f\u5ea6\u4e3a0\u7684\u5b57\u7b26\u4e32\uff0c2\u3001null\u503c\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-6a2ac42e1ee7e\" 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-6a2ac42e1ee7e\"  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\/2975\/#%E6%95%B0%E6%8D%AE\" >\u6570\u636e<\/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\/2975\/#%E9%80%9A%E8%BF%87is_null_%E6%9F%A5%E8%AF%A2%E6%98%AF%E5%90%A6%E4%B8%BAnull\" >\u901a\u8fc7is null \u67e5\u8be2\u662f\u5426\u4e3anull<\/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\/2975\/#%E9%80%9A%E8%BF%87is_not_null_%E6%9F%A5%E8%AF%A2%E9%9D%9Enull%E7%9A%84\" >\u901a\u8fc7is not null \u67e5\u8be2\u975enull\u7684<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.gbase8.cn\/en\/2975\/#%E9%80%9A%E8%BF%87%E2%80%9D%E6%9F%A5%E8%AF%A2%E7%A9%BA%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2\" >\u901a\u8fc7=&#8221;\u67e5\u8be2\u7a7a\u7684\u5b57\u7b26\u4e32<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/2975\/#%E9%80%9A%E8%BF%87%E7%BB%84%E5%90%88%E6%9D%A1%E4%BB%B6%E6%9F%A5%E8%AF%A2%E7%A9%BA%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%92%8Cnull\" >\u901a\u8fc7\u7ec4\u5408\u6761\u4ef6\u67e5\u8be2\u7a7a\u5b57\u7b26\u4e32\u548cnull<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/2975\/#%E9%80%9A%E8%BF%87nvl%E5%87%BD%E6%95%B0%E6%9F%A5%E8%AF%A2%E7%A9%BA%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%92%8Cnull\" >\u901a\u8fc7nvl\u51fd\u6570\u67e5\u8be2\u7a7a\u5b57\u7b26\u4e32\u548cnull<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.gbase8.cn\/en\/2975\/#%E5%8F%82%E8%80%83\" >\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%95%B0%E6%8D%AE\"><\/span>\u6570\u636e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5982\u4e0b\u6837\u4f8b\u6784\u9020\u4e863\u884c\u6570\u636e\uff0c\u5305\u62ec1\u884cnull,\u4e00\u4e2a''\u7684\u7a7a\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; create table tt1(id int,name varchar(100));\nQuery OK, 0 rows affected (Elapsed: 00:00:01.20)\n\ngbase&gt; insert into tt1 values(1,'First'),(2,''),(3,null);\nQuery OK, 3 rows affected (Elapsed: 00:00:00.36)\nRecords: 3  Duplicates: 0  Warnings: 0\n\ngbase&gt; select * from tt1;\n+------+-------+\n| id   | name  |\n+------+-------+\n|    1 | First |\n|    2 |       |\n|    3 | NULL  |\n+------+-------+\n3 rows in set (Elapsed: 00:00:00.01)\n\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87is_null_%E6%9F%A5%E8%AF%A2%E6%98%AF%E5%90%A6%E4%B8%BAnull\"><\/span>\u901a\u8fc7is null \u67e5\u8be2\u662f\u5426\u4e3anull<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from tt1 where name is null;\n+------+------+\n| id   | name |\n+------+------+\n|    3 | NULL |\n+------+------+\n1 row 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=\"%E9%80%9A%E8%BF%87is_not_null_%E6%9F%A5%E8%AF%A2%E9%9D%9Enull%E7%9A%84\"><\/span>\u901a\u8fc7is not null \u67e5\u8be2\u975enull\u7684<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from tt1 where name is not null;\n+------+-------+\n| id   | name  |\n+------+-------+\n|    1 | First |\n|    2 |       |\n+------+-------+\n2 rows in set (Elapsed: 00:00:00.01)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u901a\u8fc7=''\u67e5\u8be2\u7a7a\u7684\u5b57\u7b26\u4e32<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\ngbase&gt; select * from tt1 where name='';\n+------+------+\n| id   | name |\n+------+------+\n|    2 |      |\n+------+------+\n1 row in set (Elapsed: 00:00:00.00)\n\n\n\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87%E7%BB%84%E5%90%88%E6%9D%A1%E4%BB%B6%E6%9F%A5%E8%AF%A2%E7%A9%BA%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%92%8Cnull\"><\/span>\u901a\u8fc7\u7ec4\u5408\u6761\u4ef6\u67e5\u8be2\u7a7a\u5b57\u7b26\u4e32\u548cnull<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from tt1 where name is null or name='';\n+------+------+\n| id   | name |\n+------+------+\n|    2 |      |\n|    3 | NULL |\n+------+------+\n2 rows in set (Elapsed: 00:00:00.02)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%80%9A%E8%BF%87nvl%E5%87%BD%E6%95%B0%E6%9F%A5%E8%AF%A2%E7%A9%BA%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%92%8Cnull\"><\/span>\u901a\u8fc7nvl\u51fd\u6570\u67e5\u8be2\u7a7a\u5b57\u7b26\u4e32\u548cnull<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from tt1 where nvl(name,'')='';\n+------+------+\n| id   | name |\n+------+------+\n|    2 |      |\n|    3 | NULL |\n+------+------+\n2 rows in set (Elapsed: 00:00:00.01)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83\"><\/span>\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-\u8001\u7d2b\u7af9\u7684\u5bb6 wp-block-embed-\u8001\u7d2b\u7af9\u7684\u5bb6\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"NGsTMfJ7Jj\"><a href=\"https:\/\/www.gbase8.cn\/en\/2529\/\">GBase 8a\u5bf9null\u76f8\u5173\u51fd\u6570nvl\uff0cifnull,nullif\u7b49<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"\u300aGBase 8a\u5bf9null\u76f8\u5173\u51fd\u6570nvl\uff0cifnull,nullif\u7b49\u300b\u2014\u8001\u7d2b\u7af9\u7684\u5bb6\" src=\"https:\/\/www.gbase8.cn\/2529\/embed#?secret=NGsTMfJ7Jj\" data-secret=\"NGsTMfJ7Jj\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u5728GBase 8a\u6570\u636e\u5e93\u4e2d\uff0c\u5982\u4f55\u67e5\u8be2\u7a7a\u503c\u3002\u8fd9\u91cc\u7a7a\u503c\u67092\u4e2a\u63cf\u8ff0\uff1a1\u3001\u957f\u5ea6\u4e3a0\u7684\u5b57\u7b26\u4e32\uff0c2\u3001null\u503c\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2975","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2975","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=2975"}],"version-history":[{"count":2,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2975\/revisions"}],"predecessor-version":[{"id":2977,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2975\/revisions\/2977"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=2975"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=2975"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=2975"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}