Hi,
Can anyone help me create a query that will work the following:-
I need to be able to look up a company AND their parent company from the following table. Only some companies have a parent company, others that do not have a parent have themselves listed as the parent.
Table Structure is along the lines of
CompanyID
CompanyName
...
CompanyParentID
The CompanyParentID is linked to the CompanyID, and both are further linked to other tables in the database.
Example data:-
CompanyID | CompanyName | ... | CompanyParentID
1 | ABC and Co | ... | 1
2 | XYZ and Co | ... | 2
3 | Alphabet Co | ... | 2
...
Example results:
CompanyName | ParentName
ABC and Co | ABC and Co
XYZ and Co | XYZ and Co
Alphabet Co | XYZ and Co
I have managed to learn my way around linking two or more tables, but not sure how to do this when the tables are in fact the same table.
Thanks,
Adam (slightly past newbie)







Bookmarks