This is a discussion on Alter a combination of 2 existing columns as a unique key within the MySQL Database forums, part of the Database Forums category; To alter 1 column to a unique key, for example, ALTER TABLE user MODIFY COLUMN id INT NOT NULL UNIQUE; ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |