1.清空本地表数据
truncate table 数据库名.表名
:) select * from test_local; SELECT * FROM test_local Query id: ab13b5ad-4fa5-4cff-b581-8b361fa50656 ┌─id─┬─name──────┐ │ 1 │ zhangsan │ │ 2 │ lisi │ │ 7 │ yw │ │ 8 │ xc │ │ 5 │ zhangquan │ │ 6 │ lihua │ │ 11 │ bb │ │ 12 │ acca │ │ 13 │ dd │ └────┴───────────┘ aliyun-47-122-26-25 :) truncate table test_log.test_local; TRUNCATE TABLE test_log.test_local Query id: 026f93b3-b360-4d23-90b8-582e4a650b43 Ok. 0 rows in set. Elapsed: 0.001 sec. aliyun-47-122-26-25 :) select * from test_local; SELECT * FROM test_local Query id: 8dd53c9f-433b-49d9-a623-af887bfa0847 Ok. 0 rows in set. Elapsed: 0.001 sec.
2.删除表
#删除表(如果需要创新创建同名的表时,需要在删除表的SQL 后面添加 sync 关键字,用来删除zk中的表信息,否则在创建表时报错;) drop table test01.brow_local on cluster ck_cluster sync; # 下面一条可以不要 drop table test01.brow_local on cluster ck_cluster no delay;
标签:语句,常见,cluster,Query,test,table,local,id,clickhouse From: https://www.cnblogs.com/yangmeichong/p/17577554.html