I know we can add columns to a table, but is there a way that we can add a new column to a table as the first column?
I mean if I add a column named new_column to a table I'd like for it to be listed first when described... I can do this in MySQL:
Code: Select all
(mydbadmin@localhost) [(none)]> desc intersect.test;
+-------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------+------+-----+---------+-------+
| col1 | int(11) | YES | | NULL | |
| col2 | int(11) | YES | | NULL | |
+-------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)
(mydbadmin@localhost) [(none)]> alter table intersect.test add new_col int first;
Query OK, 0 rows affected (0.12 sec)
Records: 0 Duplicates: 0 Warnings: 0
(mydbadmin@localhost) [(none)]> desc intersect.test;
+---------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+-------+
| new_col | int(11) | YES | | NULL | |
| col1 | int(11) | YES | | NULL | |
| col2 | int(11) | YES | | NULL | |
+---------+---------+------+-----+---------+-------+
3 rows in set (0.01 sec)