Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing duplicates on non-key fields

Status
Not open for further replies.

y2k1981

Programmer
Aug 2, 2002
773
IE
is there a way that you can put an index on a field (like in access) so that duplicates aren't allowed? in access, you can put an index on a field and say duplicates OK or no duplicates allowed. can you do the same in MySQL?
 
create unique index <name> on table(columns)
should do it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top