How to change the column name in DB2

て烟熏妆下的殇ゞ 提交于 2020-04-12 18:12:28

问题


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.

Thanks.


回答1:


Use an ALTER TABLE statement.

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. An older version might be out of luck. I'm not sure when they added it, but it was after 2004.



来源:https://stackoverflow.com/questions/7385938/how-to-change-the-column-name-in-db2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!