I have 4 "stationary" tables.
The 1st holds my pencils, and their attributes
The 2nd holds my pens, and their attributes
The 3rd holds my paperclips, and their attributes
Table No.4 is my pencil case table. Here I store which pencils, pens and paperclips exist in which pencil case, thus:
ID, PencilCaseID, ItemType, ItemID
This is complicated due to this being a "quantum" pencil case, and the same item may exist in more than one pencil case at the same time.
To list all attributes at the same time for one pencil case the query would be:
SELECT * FROM pencilcase WHERE PencilCaseID = xyz
But how do I JOIN the item tables according to their ItemType returned from the above query?
cheers,
asp