I want to add a column to preexisting table. Can I add it in between two existing columns? I am working on phpmyadmin.
-
You can read the MySQL documentation and probably thousands of Googleable articles to learn this. – Mike Brant Aug 05 '13 at 17:55
-
Seeing as this is the first link that comes up on Google I think it's good to have an answer. – CHarris Jun 21 '17 at 22:14
6 Answers
Use the add new column after dropdown.
Select the database from the menu on the left.
Select the table by clicking on it's title column hyperlink.
Check the add new column after radio button and select the column you want to insert after in the drop down.
Click Add.
This video goes through the process http://www.youtube.com/watch?v=jZ72GCGWPQg

- 1,172
- 13
- 11
The ordering of columns in MySQL isn't of much importance. As for adding a new column,
ALTER TABLE `tblName`
ADD COLUMN `colName` INT(10) AFTER `firstCol`;
The AFTER
clause defines the position where your new column will come.

- 1
- 1

- 78,589
- 36
- 144
- 183
I think this video can help you. With PHPMyAdmin
- Go to the page of the table you want to modify
- At the bottom of the page, select you desired column in "After" (at which position you want to add your column in the table)
- Validate and enter new column information
You can also do it via plain SQL, with a ALTER TABLE
query:
ALTER TABLE mytable ADD column3 INT AFTER column1

- 34,607
- 19
- 87
- 97
Yes, you can do that. See a "after" list box in the section. you can select after which field your new field need to be added.

- 1,030
- 15
- 39
Even if you have inserted a column in the MySQL, MySQL now provides an option to click on 'move columns' button below the table.

- 177
- 5
- 18