alter table "mytable" add id int not null primary key auto_increment first;
I hope it can help you. -- João Cândido de Souza Neto "Carlos Mennens" <[email protected]> escreveu na mensagem news:[email protected]... >I have an existing table with a few columns I created a few months > ago. Sadly I left out the column I would like to use for my Primary > Key and wanted to know what is the best way to add a column to an > existing table but also I want the column to appear first before any > other columns since it's the 'id' column and will be set to PRIMARY > KEY NOT NULL. > > Thanks for any assistance. > > -Carlos -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[email protected]
