简体   繁体   English

如何更改DB2中的列名

[英]How to change the column name in DB2

I need to rename the column name of one of the table. 我需要重命名其中一个表的列名。 I have DB2 database and we are connecting with the database and executing sql queries through Eclipse IDE. 我有DB2数据库,我们正在连接数据库并通过Eclipse IDE执行sql查询。

Thanks. 谢谢。

Use an ALTER TABLE statement. 使用ALTER TABLE语句。

ALTER TABLE G31.TG31PDIX RENAME COLUMN RECORD_KEY TO RECORD_KEYY;

This will only work if you use a version of DB2 that supports this feature. 这仅在您使用支持此功能的DB2版本时才有效。 An older version might be out of luck. 旧版本可能运气不佳。 I'm not sure when they added it, but it was after 2004. 我不确定他们什么时候添加它,但它是在2004年之后。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM