How to constrain a column in my table so it can’t have two or more
similar values at a time and it isn’t a primary key ?
Should I use CHECK or CONSTRAINT or … ? what’s the right way to achieve that ?
note : I’m using MySQL
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to create a unique index:
MySQL does not implement check constraints.