{"id":2311,"date":"2020-12-08T09:45:18","date_gmt":"2020-12-08T01:45:18","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=2311"},"modified":"2020-12-08T09:54:14","modified_gmt":"2020-12-08T01:54:14","slug":"gbase-8a%e5%a4%9a%e5%88%97in%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/2311","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u591a\u5217in\u7684\u4f7f\u7528\u573a\u666f\u548c\u9650\u5236"},"content":{"rendered":"<p>GBase 8a\u652f\u6301in\u7684\u67e5\u8be2\u6761\u4ef6\uff0c\u5305\u62ec\u5355\u5217\u548c\u591a\u5217\u3002\u672c\u6587\u5bf9GBase 8a\u591a\u5217in\u7684\u4f7f\u7528\u573a\u666f\u548c\u9650\u5236\u8fdb\u884c\u4e86\u8ba8\u8bba\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-6a2b164c6ee10\" 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-6a2b164c6ee10\"  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\/2311\/#%E6%B3%A8%E6%84%8F\" >\u6ce8\u610f<\/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\/2311\/#%E4%B8%AA%E5%88%AB%E6%95%B0%E6%8D%AE%E6%98%BE%E5%BC%8F%E6%95%B0%E5%80%BC%E5%A4%9A%E5%88%97in\" >\u4e2a\u522b\u6570\u636e\u663e\u5f0f\u6570\u503c\u591a\u5217in<\/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\/2311\/#%E5%B0%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%AD%90%E6%9F%A5%E8%AF%A2%E5%A4%9A%E5%88%97in\" >\u5c11\u91cf\u6570\u636e\u5b50\u67e5\u8be2\u591a\u5217in<\/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\/2311\/#%E5%A4%A7%E9%87%8F%E6%95%B0%E6%8D%AE%E5%A4%9A%E5%88%97in\" >\u5927\u91cf\u6570\u636e\u591a\u5217in<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.gbase8.cn\/en\/2311\/#%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90\" >\u5916\u90e8\u6570\u636e\u6765\u6e90<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.gbase8.cn\/en\/2311\/#%E5%BA%93%E5%86%85%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90\" >\u5e93\u5185\u6570\u636e\u6765\u6e90<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%B3%A8%E6%84%8F\"><\/span>\u6ce8\u610f<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u56e0\u4e3ain\u90e8\u5206\u7684\u6570\u636e\uff0c\u5c06\u5168\u90e8\u8f7d\u5165\u5185\u5b58\uff0c\u4e5f\u5c31\u662f\u5982\u679cin\u90e8\u5206\u6570\u636e1000\u4e07\uff0c\u9700\u898110G\u5185\u5b58\uff0c\u90a3\u5c31\u8981\u5206\u914d10G\u5185\u5b58\uff0c\u5e76\u4e0d\u53d7\u96c6\u7fa4\u7b97\u5b50\u53c2\u6570\u7684\u9650\u5236\u3002<\/p>\n\n\n\n<p>\u5982\u4e0b\u6839\u636ein\u90e8\u5206\u7684\u6570\u636e\u91cf\uff0c\u63d0\u4f9b\u4e0d\u540c\u7684\u5199\u6cd5\u5efa\u8bae\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%B8%AA%E5%88%AB%E6%95%B0%E6%8D%AE%E6%98%BE%E5%BC%8F%E6%95%B0%E5%80%BC%E5%A4%9A%E5%88%97in\"><\/span>\u4e2a\u522b\u6570\u636e\u663e\u5f0f\u6570\u503c\u591a\u5217in<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u8fd9\u4e2a\u5199\u6cd5\u4e00\u822c\u9002\u5408\u6570\u5b57\u6bd4\u8f83\u5c11\u7684\u60c5\u51b5\uff0c\u6bd4\u5982\u51e0\u4e2a\uff0c\u51e0\u5343\u4e2a\u3002<\/p>\n\n\n\n<p>\u591a\u4e2a\u5217\u7528\u5c0f\u62ec\u53f7\u5305\u56f4\uff0c\u4e00\u7ec4\u6570\u503c\u7528\u5c0f\u62ec\u53f7\u5305\u56f4\uff0c\u6240\u6709\u6570\u5b57\u5916\u518d\u7528\u5c0f\u62ec\u53f7\u5305\u56f4\u3002\u793a\u610f\u5982\u4e0b where (a,b) in ( (X,X),(Y,Y),....)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select * from tt1;\n+------+------+------+\n| id   | id2  | id3  |\n+------+------+------+\n|    0 | -110 | -129 |\n|    1 | -110 | -123 |\n|    2 | -110 | -110 |\n|    3 | -118 | -119 |\n|    4 | -110 | -119 |\n+------+------+------+\n5 rows in set (Elapsed: 00:00:00.01)\n\ngbase> select * from tt1 where (id,id2) in ((0,-110),(1,3));\n+------+------+------+\n| id   | id2  | id3  |\n+------+------+------+\n|    0 | -110 | -129 |\n+------+------+------+\n1 row 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%B0%91%E9%87%8F%E6%95%B0%E6%8D%AE%E5%AD%90%E6%9F%A5%E8%AF%A2%E5%A4%9A%E5%88%97in\"><\/span>\u5c11\u91cf\u6570\u636e\u5b50\u67e5\u8be2\u591a\u5217in<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u5982\u679c\u6570\u503c\u7a0d\uff0c\u6bd4\u5982\u51e0\u5343\u4e2a\uff0c\u51e0\u4e07\u4e2a\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b50\u67e5\u8be2\u7684\u683c\u5f0f\u3002 \u793a\u4f8b\u5982\u4e0b\uff1a<br>where (a,b) in (select a, b from XXX)<\/p>\n\n\n\n<p>\u5b9e\u9645\u4f8b\u5b50\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select * from tt1 where (id,id2) in (select id,id3 from tt1 where id&lt;=2);\n+------+------+------+\n| id   | id2  | id3  |\n+------+------+------+\n|    2 | -110 | -110 |\n+------+------+------+\n1 row in set (Elapsed: 00:00:00.11)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%A4%A7%E9%87%8F%E6%95%B0%E6%8D%AE%E5%A4%9A%E5%88%97in\"><\/span>\u5927\u91cf\u6570\u636e\u591a\u5217in<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%A4%96%E9%83%A8%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90\"><\/span>\u5916\u90e8\u6570\u636e\u6765\u6e90<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u5982\u679c\u6570\u636e\u662f\u4ece\u5176\u5b83\u73af\u5883\u83b7\u53d6\u7684\uff0c\u90a3\u4e48\u5efa\u8bae\u521b\u5efa\u4e34\u65f6\u8868\uff0c\u5c06\u6570\u636einsert\u6216\u8005load\u8fdb\u53bb\uff0c\u7136\u540e\u6309\u7167JOIN\u7684\u65b9\u5f0f\u8fdb\u884c\u64cd\u4f5c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> create temporary table tmp_tt1(id int, id2 int);\nQuery OK, 0 rows affected (Elapsed: 00:00:01.10)\n\ngbase> insert into tmp_tt1 values(0,-110),(1,3);\nQuery OK, 2 rows affected (Elapsed: 00:00:00.44)\nRecords: 2  Duplicates: 0  Warnings: 0\n\ngbase> select a.* from tt1 a ,(select id,id2 from tmp_tt1) b where a.id=b.id and a.id2=b.id2;\n+------+------+------+\n| id   | id2  | id3  |\n+------+------+------+\n|    0 | -110 | -129 |\n+------+------+------+\n1 row in set (Elapsed: 00:00:00.06)\n\ngbase> drop temporary table tmp_tt1;\nQuery OK, 0 rows affected (Elapsed: 00:00:00.19)\n\ngbase>\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%BA%93%E5%86%85%E6%95%B0%E6%8D%AE%E6%9D%A5%E6%BA%90\"><\/span>\u5e93\u5185\u6570\u636e\u6765\u6e90<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>\u6570\u636e\u5728\u5e93\u5185\uff0c\u76f4\u63a5JOIN\u5373\u53ef<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gbase> select a.* from tt1 a ,(select id,id3 from tt1 where id&lt;=2) b where a.id=b.id and a.id2=b.id3;\n+------+------+------+\n| id   | id2  | id3  |\n+------+------+------+\n|    2 | -110 | -110 |\n+------+------+------+\n1 row in set (Elapsed: 00:00:00.08)\n<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a\u652f\u6301in\u7684\u67e5\u8be2\u6761\u4ef6\uff0c\u5305\u62ec\u5355\u5217\u548c\u591a\u5217\u3002\u672c\u6587\u5bf9\u591a\u5217in\u7684\u5199\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\u8fdb\u884c\u4e86\u6d4b\u8bd5\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-2311","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2311","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=2311"}],"version-history":[{"count":10,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2311\/revisions"}],"predecessor-version":[{"id":2321,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/2311\/revisions\/2321"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=2311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=2311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=2311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}