Inserting new columns in the middle of a table?

后端 未结 6 474
陌清茗
陌清茗 2020-12-20 14:29

When one uses \"ALTER TABLE tab ADD col\", the new column gets added to the end of the table. For example:

TABLE: TAB
COL_1 COL_2 COL_4

ALTER TABLE TAB ADD          


        
6条回答
  •  囚心锁ツ
    2020-12-20 14:38

    http://www.orafaq.com/wiki/SQL_FAQ#How_does_one_add_a_column_to_the_middle_of_a_table.3F says it can't be done, and suggests workarounds of renaming the table and doing a create table as select... or (something I am unfamiliar with) "Use the DBMS_REDEFINITION package to change the structure".

提交回复
热议问题