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" <carlosw...@gmail.com> escreveu na mensagem 
news:aanlktikfc89rhercrg5pr9yxfv8semvdv4kp9r67n...@mail.gmail.com...
>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/mysql?unsub=arch...@jab.org

Reply via email to