Reorganize Column Position Without Recreating Table.
Step_1.
Create a table:
CREATE TABLE test_table (
a INT,
b INT,
d INT,
e INT
);
Step_2.
Add a column:
ALTER TABLE test_table ADD (c INT);
Step_3.
Move the column to the middle:
ALTER TABLE test_table MODIFY (d INVISIBLE, e INVISIBLE);
ALTER TABLE test_table MODIFY (d VISIBLE, e VISIBLE);
Step_4.
DESCRIBE test_table;
Name
----
A
B
C
D
E
No comments:
Post a Comment