标签:varchar ext seq col str sequence drop tar bsp
1、列操作
新增一列:alter table [tbl_name] add column [column_name] [type] 删除一列:alter table [tbl_name] drop [column_name]; 修改列名:alter table [tbl_name] rename [column_name] to [column_name_1]; 修改列类型:alter table [tbl_name] alter COLUMN [column_name] type varchar(255)
2、序列操作
重置序列:alter sequence xxx restart with 1 创建序列:create sequence xxx START with 1 INCREMENT by 1 NO MINVALUE NO MAXVALUE CACHE 1 给某一列赋上序列:alter table [tbl_name] alter column [column_name] set default nextval(‘xxx‘)
3、设置主键
alter table [tbl_name] add constraint ‘pkey_name‘ ;
标签:varchar ext seq col str sequence drop tar bsp
原文地址:https://www.cnblogs.com/yb38156/p/10063673.html