Skip to content
Advertisement

Select when two tables reference the same table

I have two tables, tSellers and tBuyers. They both have FK to a table tCity. How do I join and select city name from a buyer and a seller in a order table?

Expected output:

Advertisement

Answer

To expand on @jarlh ‘s comment:

Example of joining on City table twice, once for Seller (to get the city of the Seller), and once for Buyer (to get the city of the Buyer).

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement