click house学习
创建表
create table blog(id UInt64,title String,content String,created_at DateTime)Engine=MergeTree order by id;
日期数据一般指定默认值
create table blog(id UInt64,title String,content String,created_at DateTime default now())Engine=MergeTree order by id;
插入测试数据
insert into blog(id,title,content) values(1,'测试1','有点小帅');
查询测试
select * from blog;
注意表名是区分大小写的
Select 则不区分大小写
distinct
和一般性的SQL一样
select distinct(title) from blog;
update语句
alter table blog update title = '测试一下' where id = 1;