{"id":2631,"date":"2020-12-29T15:53:07","date_gmt":"2020-12-29T07:53:07","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=2631"},"modified":"2020-12-29T15:54:53","modified_gmt":"2020-12-29T07:54:53","slug":"gbase-8a%e9%80%9a%e8%bf%87%e5%ae%89%e5%85%a8%e7%ad%89%e4%ba%8e%e6%93%8d%e4%bd%9c%e7%ac%a6%ef%bc%8c%e8%a7%a3%e5%86%b3%e5%8c%85%e5%90%abnull%e5%80%bc%e7%9a%84%e7%ad%89%e4%ba%8e%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/2631","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u901a\u8fc7<=>\u5b89\u5168\u7b49\u4e8e\u64cd\u4f5c\u7b26\uff0c\u89e3\u51b3\u5305\u542bnull\u503c\u7684\u7b49\u4e8e\u64cd\u4f5c"},"content":{"rendered":"<p>\u5728SQL\u6807\u51c6\u4e2d\uff0c null\u548c\u4efb\u4f55\u503c\u90fd\u4e0d\u76f8\u7b49\uff0c\u5305\u62ecnull\u81ea\u5df1\u3002\u5728GBase 8a\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u5168\u7b49\u4e8e\u64cd\u4f5c\u7b26&lt;=&gt;\u5bf9null\u4e5f\u53ef\u4ee5\u8fdb\u884c\u76f8\u7b49\u5224\u65ad\u3002\u4e00\u822c\u7528\u4e8ejoin\u7b49\u5173\u8054\u67e5\u8be2\u573a\u666f\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-6a2b165f0e6ca\" 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-6a2b165f0e6ca\"  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\/2631\/#%E6%93%8D%E4%BD%9C%E7%AC%A6%E8%AF%B4%E6%98%8E\" >\u64cd\u4f5c\u7b26\u8bf4\u660e<\/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\/2631\/#%E6%A0%B7%E4%BE%8B\" >\u6837\u4f8b<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%93%8D%E4%BD%9C%E7%AC%A6%E8%AF%B4%E6%98%8E\"><\/span>\u64cd\u4f5c\u7b26\u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>a&lt;=>b<\/code><\/pre>\n\n\n\n<p>\u8fd9\u4e2a\u64cd\u4f5c\u7b26\u50cf\u201c=\u201d\u64cd\u4f5c\u7b26\u4e00\u6837\u6267\u884c\u76f8\u7b49\u6bd4\u8f83\uff0c\u4f46\u5728\u4e0b\u9762 2 \u79cd\u60c5\u51b5\u4e0b\uff0c\u83b7\u5f97\u7684\u7ed3\u679c\u4e0e\u201c=\u201d\u4e0d\u540c\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>\u5982\u679c\u6240\u6709\u7684\u64cd\u4f5c\u6570\u90fd\u662f NULL\uff0c\u90a3\u4e48\u8fd4\u56de\u7684\u662f 1 \u800c\u4e0d\u662f NULL\u3002<\/li><li>\u5982\u679c\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u64cd\u4f5c\u6570\u662f NULL\uff0c\u90a3\u4e48\u8fd4\u56de\u7684\u662f 0 \u800c\u4e0d\u662f NULL<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%A0%B7%E4%BE%8B\"><\/span>\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u76f4\u63a5\u5224\u65ad\uff0c\u53ef\u4ee5\u770b\u5230null\u867d\u7136\u4e0d\u7b49\u4e8e\u5176\u5b83\u503c\u4e86\uff0c\u4f46null &lt;=&gt; null\u662f\u8fd4\u56detrue\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select 1&lt;=&gt;1,1&lt;=&gt;null,null&lt;=&gt;1,null&lt;=&gt;null;\n+-------+----------+----------+-------------+\n| 1&lt;=&gt;1 | 1&lt;=&gt;null | null&lt;=&gt;1 | null&lt;=&gt;null |\n+-------+----------+----------+-------------+\n|     1 |        0 |        0 |           1 |\n+-------+----------+----------+-------------+\n1 row in set (Elapsed: 00:00:00.00)\n<\/code><\/pre>\n\n\n\n<p>\u5982\u4e0b\u662f\u5173\u8054\u67e5\u8be2\u7684\u4f8b\u5b50\uff0c\u7531\u4e8e\u539f\u59cb\u6570\u636e\u91cc\u5305\u542b\u4e86null\u503c\uff0c\u5bf9\u5e94\u662f\u4e0d\u4f1a\u88ab\u5173\u8054\u4e0a\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select * from testnull;\n+------+-------+\n| id   | name  |\n+------+-------+\n|    1 | First |\n|    2 | NULL  |\n+------+-------+\n2 rows in set (Elapsed: 00:00:00.01)\n\ngbase&gt; select * from testnull2;\n+-------+\n| name  |\n+-------+\n| NULL  |\n| First |\n+-------+\n2 rows in set (Elapsed: 00:00:00.01)\ngbase&gt; select a.* from testnull a inner join testnull2 b on a.name = b.name;\n+------+-------+\n| id   | name  |\n+------+-------+\n|    1 | First |\n+------+-------+\n1 row in set (Elapsed: 00:00:00.03)\n<\/code><\/pre>\n\n\n\n<p>\u4f46\u5982\u679c\u7528\u4e86 &lt;=&gt;\u5b89\u5168\u7b49\u4e8e\uff0c\u5219\u53ef\u4ee5\u8fd4\u56de\u671f\u671b\u7684\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase&gt; select a.* from testnull a inner join testnull2 b on a.name &lt;=&gt; b.name;\n+------+-------+\n| id   | name  |\n+------+-------+\n|    1 | First |\n|    2 | NULL  |\n+------+-------+\n2 rows in set (Elapsed: 00:00:00.07)\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>\u5728SQL\u6807\u51c6\u4e2d\uff0c null\u548c\u4efb\u4f55\u503c\u90fd\u4e0d\u76f8\u7b49\uff0c\u5305\u62ecnull\u81ea\u5df1\u3002\u5728GBase 8a\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b89\u5168\u7b49\u4e8e\u64cd\u4f5c\u7b26<=>\u5bf9null\u4e5f\u53ef\u4ee5\u8fdb\u884c\u76f8\u7b49\u5224\u65ad\u3002\u4e00\u822c\u7528\u4e8ejoin\u7b49\u5173\u8054\u67e5\u8be2\u573a\u666f\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-2631","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2631","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=2631"}],"version-history":[{"count":2,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2631\/revisions"}],"predecessor-version":[{"id":2633,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2631\/revisions\/2633"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=2631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=2631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=2631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}