Help needed with unique key (MYSQL)
here is a a description of my database id,col1,col2.
what i want to do is have unique key from col1,col2.
which means that if there is a record such as
id=1 , col1=1 , col2=2
there can’t be a record such as
id=5 , col1= 2 , col2=1.
I have tried creating two indexes such as
index1:col1,col2 unique
and
index2:col2,col1 unique but these only keeps out from inserting
again id=1 , col1=1 , col2=2
In other word the unique key must check the combinations.
I am using mysql.