ALTER 语句修改数据表
1.修改数据表名
ALTER TABLE [方案名.]OLD_TABLE_NAME RENAME TO NEW_TABLE_NAME;
ALTER TABLE [方案名.]OLD_TABLE_NAME RENAME TO NEW_TABLE_NAME;
2.修改列名
ALTER TABLE [方案名.]TABLE_NAME RENAME COLUMN OLD_COLUMN_NAME TO NEW_COLUMN_NAME;
ALTER TABLE [方案名.]TABLE_NAME RENAME COLUMN OLD_COLUMN_NAME TO NEW_COLUMN_NAME;
3.修改列的数据类型
ALTER TABLE [方案名.]TABLE_NAME MODIFY COLUMN_NAME NEW_DATATYPE;
ALTER TABLE [方案名.]TABLE_NAME MODIFY COLUMN_NAME NEW_DATATYPE;
4.插入列
ALTER TABLE [方案名.]TABLE_NAME ADD COLUMN_NAME DATATYPE;
ALTER TABLE [方案名.]TABLE_NAME ADD COLUMN_NAME DATATYPE;
5.删除列
ALTER TABLE [方案名.]TABLE_NAME DROP COLUMN COLUMN_NAME;
ALTER TABLE [方案名.]TABLE_NAME DROP COLUMN COLUMN_NAME;