General information
Category:
Coding, syntax & commands
Title:
SQL - 2 Different FKs into the same LookUp table
I have a parent table that needs to make two separate references back to the same table and I am having trouble forming a SQL SELECT command to do this.
Example: A table that holds escrows has a Foreign Key (FK) back to the Primary Key in the contact person's table for the escrow officer. Simple enough. But I also want to have a Foreign Key reference the PK in the same contact person's table for the lender as well. The contact person's table has a type field that distinguishes the different types of people. How would I create a SQL Select statement that knows which person is the escrow officer and which one is the lender? How do I get around the "Duplicate Alias" error message. Was it bad design to put all my people: agents, lenders, escrow officers, etc... in the same table?
- Paul
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only