VN:F [1.9.22_1171]
Rating: 8.3/10 (9 votes cast)

This query will show you how to insert a new column after a specific column in mysql.

mysql
For example :- To insert the new column after a specific column, such as name, use this statement:

ALT ER TABLE contacts ADD email VARCHAR(60) AFTER name;

If you want the new column to be first, use this statement:

ALT ER TABLE contacts ADD email VARCHAR(60) FIRST;
VN:F [1.9.22_1171]
Rating: 8.3/10 (9 votes cast)
2 thoughts on “To insert the new column after a specific column using mysql”
  1. Is it possible to add multiple columns after a specific existent column using one query?
    Say you want to add the columns ’email’ and ‘telephone’ after the column ‘name’..

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    1. Yes it is possible,
      Try this [mysql]ALTER TABLE my_table
      ADD COLUMN col_1 date,
      ADD COLUMN col_2 date,
      ADD COLUMN col_3 date;[/mysql]

      VN:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)

Leave a Reply

Your email address will not be published. Required fields are marked *