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;

image

注意表名是区分大小写的

image

Select 则不区分大小写

distinct

和一般性的SQL一样

select distinct(title) from blog;

update语句

alter table blog update title = '测试一下' where id = 1;
posted @ 2023-04-01 15:15  沙漠皇帝  阅读(79)  评论(0编辑  收藏  举报