The above works for a one to one relation but not a many to many. If you have 3 tables, table A, B and C.
A: AID - Primary Key
B: AID - Composite primary key CID - Composite primary key
C: CID - Primary Key Name - Text
The following values in the tables A: AID = 1
B: AID = 1 CID = 1
AID = 1 CID = 2
C: CID = 1 Name = a
CID = 2 Name = b
The code you sugest returns the following give the above situation: Given AID of 1 result CID = 1 Instead of CID = 1 and CID =2 |