OriginalSunny Posted March 12, 2006 Share Posted March 12, 2006 Hi, i want to add some columns to me table after other columns already exsistent in the table. I know the following command works:alter table tablename add column columnname ... first;This puts the column at the beginning of the table. How do i place it so its the third column in the table or so that it is after another column?? Thanks. Quote Link to comment Share on other sites More sharing options...
shoz Posted March 12, 2006 Share Posted March 12, 2006 [!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']ALtER TABLE[/span] tablename ADD newcolumn ... AFTER othercolumn [!--sql2--][/div][!--sql3--][a href=\"http://dev.mysql.com/doc/refman/4.1/en/alter-table.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/4.1/en/alter-table.html[/a] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.