Website Scripts And Cloud Tutorials

How to insert new column after a specific column in mysql

Byadmin

Feb 3, 2011
mysql_install_redhat

Last updated on March 1st, 2022 at 09:02 am

Click to rate this tutorial!
[Total: 9 Average: 4.2]

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:

ALTER TABLE contacts ADD email VARCHAR(60) AFTER name;

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

ALTER TABLE contacts ADD email VARCHAR(60) FIRST;
Click to rate this tutorial!
[Total: 9 Average: 4.2]
2 thoughts on “How to insert new column after a specific column in 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’..

Leave a Reply

Your email address will not be published.