# Miscellaneous > SQL Scripts >  MySQL ALTER TABLE Query

## el_numptio

Hiya!

Hopefully this is a nice easy one. I'm trying to add a new column to a table. Not difficult. But I want to insert it in a specific position in the table. I can't find a simple way to do this - but there MUST be one, right?

Cheers

----------


## skhanal

New column added with ALTER statement always gets added at the end. Only way to put it in the middle is recreate the table.

----------


## el_numptio

thanks. so I can make a temporary table containing all my original columns PLUS the new columns inserted in the correct positions. is there an easy way to copy the contents of the old table into the correct columns in the new table? some form of JOIN statement perhaps...? obviously I can do this with a simple script but I have quite a lot of columns and if there's an automated method that'd be much easier...

----------


## greenman

No, you can add a column wherever you want. Use something like:
ALTER TABLE t ADD f2 TINYINT NOT NULL AFTER f1;

----------


## nicc777

Or use phpMyAdmin

Cheers

----------

