View Single Post

  #2 (permalink)  
Old 04-19-2007
Paul Lautman
 
Posts: n/a
Default Re: Alter a combination of 2 existing columns as a unique key

JH wrote:
> To alter 1 column to a unique key, for example,
>
> ALTER TABLE user MODIFY COLUMN id INT NOT NULL UNIQUE;
>
> But how to set a combination of 2 columns as a unique key?
> Individual keys are not unique, but combination is.
>
>
> TIA,
> James


Have you thought of looking here:
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html


Reply With Quote