My Blog List

Sunday, June 24, 2012

mysql unique setting

ALTER TABLE [table] ADD UNIQUE (USER_ID)

First of all, you can make some column unique when creating table

CREATE TABLE Persons
(
seq int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
UNIQUE (seq)
)
Second, when you alter table.

ALTER TABLE TB_USER ADD UNIQUE (USER_ID);


No comments:

Post a Comment