Can i able to reorder the column positions in oracle?
If yes, then how i'm going to do that?
i'm also tried this
ALTER TABLE PANEL ADD ID NUMBER GENERATED BY DEFAULT AS IDENTITY FIRST;
Can i able to reorder the column positions in oracle?
If yes, then how i'm going to do that?
i'm also tried this
ALTER TABLE PANEL ADD ID NUMBER GENERATED BY DEFAULT AS IDENTITY FIRST;
If you wish to reorder the columns as they are stored sequentially in blocks, and as they would appear when doing SELECT *
, you must recreate the table.
CREATE TABLE AS SELECT
to do this in one step)But in most cases there is no real need to do this, as physical column order and order of presentation by queries are not correlated. It only matters for SELECT *
or for INSERT VALUES
without specifying column lists, neither of which are good programming practices. [I suppose if you did have a table over 255 columns (bad idea) you could put the most accessed columns in the first 255 and push any rarely access columns to later positions to decrease the amount of row chain reads, but a better solution is to break the table up and keep under 255 cols at all times]