How do I specify unique constraint for multiple columns in MySQL?
Asked 07 September, 2021
Viewed 2.1K times
  • 54
Votes

I have a table:

table votes (
    id,
    user,
    email,
    address,
    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.

14 Answer