CONNECT TO SAMPLES
CREATE TABLE T_TEST (
F_ID BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1, NO CACHE ) ,
F_NAME VARCHAR (10) )
CONNECT RESET
第二种就是修改已有表的字段为自增字段:
db2 =>alter table ORGAN_NODE alter column ID set GENERATED ALWAYS AS
IDENTITY (START WITH 1, INCREMENT BY 1, NO CACHE )
ALTER TABLE 表名 ADD COLUMN 字段 CHAR(1) CHECK (字段 in ('T', 'F'))COMMENT ON column 模式名.表名.字段 IS 't和f的注释'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)