alter table 表名 add 字段名 数据类型 default 默认值
说明:数据类型如,varchar(50)
alter table BANK_SOKECT_INFO ADD COLUMN DEPTNO varchar(8);
如何删除表中字段
ALTER table 表名 DROP column 字段名
ALTER TABLE — 更改表属性
语法
ALTER TABLE table [ * ]
ADD [ COLUMN ] column type
ALTER TABLE table [ * ]
ALTER [ COLUMN ] column { SET DEFAULT value | DROP DEFAULT }
ALTER TABLE table [ * ]
RENAME [ COLUMN ] column TO newcolumn
ALTER TABLE table
RENAME TO newtable
ALTER TABLE table
ADD table constraint definition
Inputs
table
试图更改的现存表的名称.
column
现存或新的列名称.
type
新列的类型.
newcolumn
现存列的新名称
说明:数据类型如,varchar(50)
alter table BANK_SOKECT_INFO ADD COLUMN DEPTNO varchar(8);
如何删除表中字段
ALTER table 表名 DROP column 字段名
ALTER TABLE — 更改表属性
语法
ALTER TABLE table [ * ]
ADD [ COLUMN ] column type
ALTER TABLE table [ * ]
ALTER [ COLUMN ] column { SET DEFAULT value | DROP DEFAULT }
ALTER TABLE table [ * ]
RENAME [ COLUMN ] column TO newcolumn
ALTER TABLE table
RENAME TO newtable
ALTER TABLE table
ADD table constraint definition
Inputs
table
试图更改的现存表的名称.
column
现存或新的列名称.
type
新列的类型.
newcolumn
现存列的新名称