Re-order columns of table in Oracle

前端 未结 5 793
粉色の甜心
粉色の甜心 2020-12-07 20:18

I have a table with 50+ columns and I need to swap the order of the first two columns. What is the best way to accomplish this using Oracle? Assume the table name is ORDERDE

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-07 21:05

    Use the View for your efforts in altering the position of the column: CREATE VIEW CORRECTED_POSITION AS SELECT co1_1, col_3, col_2 FROM UNORDERDED_POSITION should help.

    This requests are made so some reports get produced where it is using SELECT * FROM [table_name]. Or, some business has a hierarchy approach of placing the information in order for better readability from the back end.

    Thanks Dilip

提交回复
热议问题