{"id":5665,"date":"2021-04-27T13:06:40","date_gmt":"2021-04-27T05:06:40","guid":{"rendered":"https:\/\/www.gbase8.cn\/?p=5665"},"modified":"2021-05-18T10:44:34","modified_gmt":"2021-05-18T02:44:34","slug":"clickhouse-sql%e6%8a%a5%e9%94%99expected-one-of-storage-definition-engine-as","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/5665","title":{"rendered":"clickhouse \u5efa\u8868create table \u62a5\u9519Expected one of: storage definition, ENGINE, AS"},"content":{"rendered":"<p>clickhouse\u5728\u5efa\u8868create table\u65f6\uff0c\u5fc5\u987b\u6307\u5b9a\u5f15\u64ce\u7c7b\u578b\uff0c\u5426\u5219\u5c31\u4f1a\u62a5Expected one of: storage definition, ENGINE, AS\u9519\u8bef\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-6a2b2c9e9bc65\" 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-6a2b2c9e9bc65\"  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\/5665\/#%E6%8A%A5%E9%94%99%E6%A0%B7%E4%BE%8B\" >\u62a5\u9519\u6837\u4f8b<\/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\/5665\/#%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88\" >Solution<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%8A%A5%E9%94%99%E6%A0%B7%E4%BE%8B\"><\/span>\u62a5\u9519\u6837\u4f8b<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) create table t1(id int, name varchar(100),birthday date);\nSyntax error: failed at position 57 (end of query):\ncreate table t1(id int, name varchar(100),birthday date);\nExpected one of: storage definition, ENGINE, AS<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88\"><\/span>Solution<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u589e\u52a0\u5f15\u64ce\u6307\u5b9a\uff0c\u5e76\u4e14\u6309\u7167\u5f15\u64ce\u8981\u6c42\u63d0\u4f9b\u5fc5\u8981\u7684\u53c2\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>localhost :) create table t1(id int, name varchar(100),birthday date)ENGINE = MergeTree() primary key id;\n\nCREATE TABLE t1\n(\n    `id` int,\n    `name` varchar(100),\n    `birthday` date\n)\nENGINE = MergeTree\nPRIMARY KEY id\n\nQuery id: 5f8f94dc-3db7-429c-b954-32538c859095\n\nOk.\n\n0 rows in set. Elapsed: 0.057 sec.\n\nlocalhost :)\n<\/code><\/pre>\n\n\n\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>clickhouse\u5728\u5efa\u8868\u65f6\uff0c\u5fc5\u987b\u6307\u5b9a\u5f15\u64ce\u7c7b\u578b\uff0c\u5426\u5219\u5c31\u4f1a\u62a5Expected one of: storage definition, ENGINE, AS\u9519\u8bef\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86],"tags":[],"class_list":["post-5665","post","type-post","status-publish","format-standard","hentry","category-clickhouse"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5665","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=5665"}],"version-history":[{"count":2,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5665\/revisions"}],"predecessor-version":[{"id":5668,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/5665\/revisions\/5668"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=5665"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=5665"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=5665"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}