{"id":10794,"date":"2023-02-25T17:35:43","date_gmt":"2023-02-25T09:35:43","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=10794"},"modified":"2023-02-25T17:35:44","modified_gmt":"2023-02-25T09:35:44","slug":"gbase-8a-%e5%a2%9e%e5%8a%a0%e6%95%b0%e5%ad%a6%e8%bf%90%e7%ae%97%e5%90%8e%e7%9a%84%e5%b0%8f%e6%95%b0%e7%82%b9%e5%90%8e%e7%b2%be%e5%ba%a6%e4%bd%8d%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/10794","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a \u589e\u52a0\u6570\u5b66\u8fd0\u7b97\u540e\u7684\u5c0f\u6570\u70b9\u540e\u7cbe\u5ea6\u4f4d\u6570"},"content":{"rendered":"<p>GBase 8a \u53ef\u4ee5\u901a\u8fc7\u51fd\u6570\u8fd0\u7b97\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u6307\u5b9a\u5c0f\u6570\u70b9\u540e\u7684\u7cbe\u5ea6\u4f4d\u6570\uff0c\u800c\u9ed8\u8ba4\u7684\u6570\u5b57\u8fd0\u7b97\u4e3a4\u4f4d\u5c0f\u6570\uff0c\u66f4\u9ad8\u7684\u7cbe\u5ea6\u9700\u8981\u7528decimal\u7c7b\u578b\uff0c\u901a\u8fc7\u6307\u5b9a\u7684\u7cbe\u5ea6\u6765\u8fdb\u884c\u8ba1\u7b97\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-6a2aeac3db960\" 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-6a2aeac3db960\"  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\/10794\/#%E9%BB%98%E8%AE%A4%E7%9A%84%E6%95%B0%E5%AD%97%E8%BF%90%E7%AE%97\" >\u9ed8\u8ba4\u7684\u6570\u5b57\u8fd0\u7b97<\/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\/10794\/#%E5%B0%86%E6%95%B0%E5%AD%97cast%E6%88%90decimal%E5%B9%B6%E6%8C%87%E5%AE%9A%E7%B2%BE%E5%BA%A6%EF%BC%8C%E6%9D%A5%E5%AE%9E%E7%8E%B0%E6%9B%B4%E9%AB%98%E7%9A%84%E5%B0%8F%E6%95%B0%E7%82%B9%E7%B2%BE%E5%BA%A6%E4%BD%8D%E6%95%B0\" >\u5c06\u6570\u5b57cast\u6210decimal\u5e76\u6307\u5b9a\u7cbe\u5ea6\uff0c\u6765\u5b9e\u73b0\u66f4\u9ad8\u7684\u5c0f\u6570\u70b9\u7cbe\u5ea6\u4f4d\u6570<\/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\/10794\/#%E5%AF%B9%E4%BA%8E%E8%A1%A8%E5%AD%97%E6%AE%B5%E7%B1%BB%E5%9E%8B%EF%BC%8C%E9%BB%98%E8%AE%A4%E4%B9%9F%E6%98%AF%E4%BB%A5decimal%E7%9A%84%E7%B2%BE%E5%BA%A6%E4%B8%BA%E5%87%86%E7%9A%84\" >\u5bf9\u4e8e\u8868\u5b57\u6bb5\u7c7b\u578b\uff0c\u9ed8\u8ba4\u4e5f\u662f\u4ee5decimal\u7684\u7cbe\u5ea6\u4e3a\u51c6\u7684<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%BB%98%E8%AE%A4%E7%9A%84%E6%95%B0%E5%AD%97%E8%BF%90%E7%AE%97\"><\/span>\u9ed8\u8ba4\u7684\u6570\u5b57\u8fd0\u7b97<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u9ed8\u8ba42\u4e2a\u6570\u5b57\u8fd0\u7b97\uff0c\u53ea\u67094\u4f4d\u5c0f\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase> select 1\/1024000;\r\n+-----------+\r\n| 1\/1024000 |\r\n+-----------+\r\n|    0.0000 |\r\n+-----------+\r\n1 row in set (Elapsed: 00:00:00.01)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%B0%86%E6%95%B0%E5%AD%97cast%E6%88%90decimal%E5%B9%B6%E6%8C%87%E5%AE%9A%E7%B2%BE%E5%BA%A6%EF%BC%8C%E6%9D%A5%E5%AE%9E%E7%8E%B0%E6%9B%B4%E9%AB%98%E7%9A%84%E5%B0%8F%E6%95%B0%E7%82%B9%E7%B2%BE%E5%BA%A6%E4%BD%8D%E6%95%B0\"><\/span>\u5c06\u6570\u5b57cast\u6210decimal\u5e76\u6307\u5b9a\u7cbe\u5ea6\uff0c\u6765\u5b9e\u73b0\u66f4\u9ad8\u7684\u5c0f\u6570\u70b9\u7cbe\u5ea6\u4f4d\u6570<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u6ce8\u610f\uff0c\u6307\u5b9a\u7684\u662f10\u4f4d\uff0c\u7ed3\u679c\u4e3a14\u4f4d\uff0cGBase\u9ed8\u8ba4\u989d\u5916\u591a\u51fa\u67654\u4f4d\u7ed3\u679c\uff0c\u907f\u514d\u7cbe\u5ea6\u4e22\u5931\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase> select cast(1 as decimal(60,10))\/1024000;\r\n+-----------------------------------+\r\n| cast(1 as decimal(60,10))\/1024000 |\r\n+-----------------------------------+\r\n|                  0.00000097656250 |\r\n+-----------------------------------+\r\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u7ed3\u679c\u96c6\u9700\u898110\u4e3a\uff0c\u53ef\u4ee5\u7528round\u7b49\u51fd\u6570\u6307\u5b9a<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>gbase> select round(cast(1 as decimal(60,10))\/1024000,10);\r\n+---------------------------------------------+\r\n| round(cast(1 as decimal(60,10))\/1024000,10) |\r\n+---------------------------------------------+\r\n|                                0.0000009766 |\r\n+---------------------------------------------+\r\n1 row in set (Elapsed: 00:00:00.00)<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AF%B9%E4%BA%8E%E8%A1%A8%E5%AD%97%E6%AE%B5%E7%B1%BB%E5%9E%8B%EF%BC%8C%E9%BB%98%E8%AE%A4%E4%B9%9F%E6%98%AF%E4%BB%A5decimal%E7%9A%84%E7%B2%BE%E5%BA%A6%E4%B8%BA%E5%87%86%E7%9A%84\"><\/span>\u5bf9\u4e8e\u8868\u5b57\u6bb5\u7c7b\u578b\uff0c\u9ed8\u8ba4\u4e5f\u662f\u4ee5decimal\u7684\u7cbe\u5ea6\u4e3a\u51c6\u7684<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u9ed8\u8ba4\u5b57\u6bb5\u8fd0\u7b97\u7ed3\u679c\uff0c\u4e5f\u662f\u5b9a\u4e49\u7684\u7cbe\u5ea6+4\u4f4d<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>\ngbase> create table tdecimal(num decimal(60,8));\nQuery OK, 0 rows affected (Elapsed: 00:00:00.38)\n\ngbase> insert into tdecimal values (1),(2.3456789);\nQuery OK, 2 rows affected (Elapsed: 00:00:00.11)\nRecords: 2  Duplicates: 0  Warnings: 0\n\ngbase> select * from tdecimal;\n+------------+\n| num        |\n+------------+\n| 1.00000000 |\n| 2.34567890 |\n+------------+\n2 rows in set (Elapsed: 00:00:00.06)\n\ngbase> select num,num\/123456 from tdecimal;\n+------------+----------------+\n| num        | num\/123456     |\n+------------+----------------+\n| 1.00000000 | 0.000008100052 |\n| 2.34567890 | 0.000019000121 |\n+------------+----------------+\n2 rows in set (Elapsed: 00:00:00.01)<\/code><\/pre>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>\u5357\u5927\u901a\u7528GBase 8a \u53ef\u4ee5\u901a\u8fc7\u51fd\u6570\u8fd0\u7b97\u7684\u7b2c\u4e8c\u4e2a\u53c2\u6570\u6307\u5b9a\u5c0f\u6570\u70b9\u540e\u7684\u7cbe\u5ea6\u4f4d\u6570\uff0c\u800c\u9ed8\u8ba4\u7684\u6570\u5b57\u8fd0\u7b97\u4e3a4\u4f4d\u5c0f\u6570\uff0c\u66f4\u9ad8\u7684\u7cbe\u5ea6\u9700\u8981\u7528decimal\u7c7b\u578b\uff0c\u901a\u8fc7\u6307\u5b9a\u7684\u7cbe\u5ea6\u6765\u8fdb\u884c\u8ba1\u7b97\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-10794","post","type-post","status-publish","format-standard","hentry","category-gbase8a"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/10794","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=10794"}],"version-history":[{"count":2,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/10794\/revisions"}],"predecessor-version":[{"id":10796,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/10794\/revisions\/10796"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=10794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=10794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=10794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}