Home / Database / MySQL: How to add a new column to an existing table

HowToPlaza Earn money writing

MySQL: How to add a new column to an existing table

by Sarah Watts

Do you want to add a new column to an existing table in MySQL. You cannot only add a new column, you can even decide the positioning of the column in your MySQL database table. For instance, if you want to add a new column in the last, you merely use this command:

alter table mytable add column new_column_name varchar(255)

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

alter table mytable add new column new_column_name varchar(255) first

And if you want this new column to appear after an already existing column you do the following:

alter table mytable add new column new_column_name after older_column_name


Technorati Tags:


Related posts

  • No Related Post
  • oh,my god ! there are a lot of beautiful blog. I like reading article ! I will always come here.
  • Narmadha
    Upto to the requirement.
    Crisp and clear.
  • Best places to play, best strategies to win. Player ratings & reviews of top online casinos & pokers with highest payouts & biggest bonuses.
blog comments powered by Disqus

Previous post:

Next post: