Forum Discussion

Mr_Gou's avatar
Mr_Gou
Copper Contributor
Jun 29, 2022

Multiple relationships to the same table for each row

I have a database with a design similar to this: For each record, I have two fields that are related to the same table (a directory of people). The Seller and Manufacturer fields are defined a...
  • George_Hepworth's avatar
    Jun 29, 2022

    Mr_Gou 

    First, this is a suboptimal approach: " The Seller and Manufacturer fields are defined as lookups to the people table." Lookups are an inferior way to manage related values in tables.  While it is true that Microsoft implemented them a long time ago, and a lot of people have been lured into using them, it's simply not a good design. Return to the basic Primary Key/Foreign Key designation and save a lot of grief for yourself.

     

    That said, the solution to creating a query here is to add the People table to the query TWICE. Alias the two instances as "Seller" and "Manufacturer" so you know which is which. Then join Primary Key of the Seller instance to the Seller Foreign Key and the Primary Key of  the Manufacturer instance to the Manufacturer Foreign Key.

Resources