Take the 2-minute tour ×  I have a table:  table votes (
primary key(id),  Now I want to make the columns user, email,
address unique (together).  How do I do this in MySql?    • Of
course the example is just... an example. So please don't worry
about the semantics. share|improve this question you could
modify your question to How do I specify a composite unique
constraint in MySQL? –  systemovich Oct 6 '10 at 17:17 @Geoffrey
Van Wyk then the people that don't know SQL terminology will
never find this question or it's answer. –  Timo Huovinen Feb 1
'12 at 13:43 I just found this question by searching on "mysql
unique multiple columns." so yes, the scenario @YuriKolovsky
mentioned is possible. Thanks, OP! This is a good starting
point, and without this question I wouldn't have know what part
of TFM I need to read. –  octern Mar 12 '12 at 21:00  9 Answers
9  up vote 542 down vote accepted ALTER TABLE `votes` ADD UNIQUE
`unique_index`(`user`, `email`, `address`); share|improve this
answer +1 Perfect, simple