Oracle move column to the first position

后端 未结 8 2125
借酒劲吻你
借酒劲吻你 2021-01-17 23:39

Is there any way to move an column in an Oracle table from last to first position? Someone has dropped the ID column, and recreated it. So now it is at the end, which is a p

8条回答
  •  我在风中等你
    2021-01-18 00:29

    The Oracle FAQ says:

    Oracle only allows columns to be added to the end of an existing table.

    You'd have to recreate your table.

    RENAME tab1 TO tab1_old;
    
    CREATE TABLE tab1 AS SELECT id,  FROM tab1_old;
    

提交回复
热议问题