查看表employee1
db2 describe table db2inst.employee1
输入:
db2 "alter table employee1 add birth char(10)"
用于添加列:birth
其中,employee1 是表名;birth 是要添加列的名称
在查看表employee1
db2 describe table db2inst.employee1
可见成功添加一列birth
问题不明确.如果只是要查看某一省的.那只要用LIST命令即可完成.如要显示B表中所有"广东"省的记录.可以执行如下 *** 作USE B
LIST ALL FOR SUBSTR(ADDRX,1,4)="广东"&&意思是显示B表中所有ADDRX字段中前两个汉字为广东的记录
思路,外键名 foreign key references 主键表名(主键列名)alter table tb_car add safecomp_no string null foreign key references tb_safecomp(safecomp_no)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)