I have a table
table userinfo (
user,
email,
address,
primary key(user)
);
In this table ‘user’ field is same as ’email’ at the time of insertion. But user can change their ’email’ latter on.
So i want email to be unique as well and insert query to fail if email already exists in the table.
Is it Possible?
Thanks in advance and this is just an example.
yes, add a
UNIQUEconstraintthe table will now have unique
USERand uniqueEmail.