查看表employee1
db2 describe table db2inst.employee1
输入:
db2 "alter table employee1 add birth char(10)"
用于添加列:birth
其中,employee1 是表名;birth 是要添加列的名称
在查看表employee1
db2 describe table db2inst.employee1
可见成功添加一列birth
create table a_1 (birth date)create table a_2 (birth timestamp)
select * from a_1
insert into a_1 values('2014-03-22')
insert into a_2 values('2014-03-22')
DB2中date类型和timestamp类型都可以使用上面格式。
只能加13W条数据?我可以理解为两种意思,一种是限制只能有13W条数据,满13W条数据后,就不再添加数据。这种情况可以使用触发器,每次插入之前判断当前表的总数,超过了就报错或者删除都可以。
第二种是添加13W条数据,可以写存储过程或者程序,在程序内部控制总条数。
希望对你有帮助!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)