How to relate a double indexed table?
I have three tables:
Favorates, table1, table2
Favorates contain (UserName, ItemID, TypeID)
Table1 and table1 contain the detailed information about (ItemID) in favorates depending on it's type. If ItemId type is 1 then details are in table1, if ItemID type is 2 Then details are in table2.
Favoraes table key is (UserName+ItemID), i.e, one uername cannot have the same item more than once.
How can I create the relation between favorates table and the other two? ItemID value is always either a key of table one or table 2??
I would be thankfull to whoever help,,,
If you don't have the one you love, love the one you have
|