Clickhouse Beginner to Master-Clickhouse Basic Commands

1. Specify engine for table creation

CREATE TABLE tb_test1 ( id Int8, name String ) ENGINE = Merge Tree;

2. Copy the table structure and create the table

create table log3 as log2 ;

3. Add fields

alter table tb_test2 add column age UInt8 COMMENT 'comment';

alter table tb_test2 add column gender String after name ;

4. Delete fields

alter table tb_test2 drop column age ;

5. Modify field type

alter table tb_test2 modify column gender UInt8 default 0 ;

6. Modify and add field comments

alter table tb_test2 comment column name 'username';

7. Modify multiple tables

rename table tb_test2 to t2 , t1 to tt1 ;
 

Guess you like

Origin blog.csdn.net/wangguoqing_it/article/details/130324282