Possible Duplicate:
How do I specify unique constraint for multiple columns in MySQL?
I am new to MySQL and have a table that I am converting to MySQL which contains "order guides" for accounts which are all the items an account normally orders. I need to prevent an insert in the case of an item (product number) for an account is already in the order guide table which is dependent on the combination of the uniqueness of two fields. Simplified example of the data in the order guide table:
uID Account_Num Prod_Num
0 1000 2000
1 1000 2010
2 1000 2020
3 1000 2030
4 1001 2000
5 1001 2010
6 1001 2020
7 1001 2021
I can not just make the "Account_Num" and "Prod_Num" fields unique. I need a way to set a rule or something to specify if the combination of "Account_Num" and "Prod_Num" are unique allow insert. The uID field is a unique auto increment field. Is this possible?