How do I specify unique constraint for multiple columns in MySQL?

Posted by Niyaz on Stack Overflow See other posts from Stack Overflow or by Niyaz
Published on 2009-03-11T19:12:31Z Indexed on 2010/05/07 21:28 UTC
Read the original article Hit count: 235

Filed under:
|
|
|
|

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?

Thanks in advance.

  • Of course the example is just... an example. So please don't worry about the semantics.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about constraints