How do I rename a column in a database table using SQL?

前端 未结 11 1680
时光说笑
时光说笑 2020-12-12 18:25

If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible?

This

11条回答
  •  爱一瞬间的悲伤
    2020-12-12 19:18

    In Informix, you can use:

    RENAME COLUMN TableName.OldName TO NewName;
    

    This was implemented before the SQL standard addressed the issue - if it is addressed in the SQL standard. My copy of the SQL 9075:2003 standard does not show it as being standard (amongst other things, RENAME is not one of the keywords). I don't know whether it is actually in SQL 9075:2008.

提交回复
热议问题