...

View Full Version : A second, subordinate key?



turpentyne
10-18-2011, 03:50 AM
Is this possible: I have a table with a unique autofill field. Then there is a second numerical field to tie the info to entries in another table. This field will have multiple matching entries.

Finally I have a third field that will be an integer between 1 - 20. I want this third field to only allow one of each number for all entries with the same number in column 2. (I hope that made sense!)

Example:



------------------------------
key1 | id2 | 1 | other fields
------------------------------
key2 | id2 | 2 | other fields
------------------------------
key3 | id6 | 1 | other fields
------------------------------
key4 | id8 | 8 | other fields
------------------------------

I want this to not be allowed, because there is already a 1 that matches id2:

key1 | id2 | 1 | other fields

BubikolRamios
10-18-2011, 08:37 AM
create unique index on second and third column



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum