Suppose I have a table_1 with two columns: buyer_id and seller_id. I have another table, table_2, with two columns: person_id, city. My goal is a table with four columns: buyer_id, buyer_city, seller_id, seller_city.
I know I could get halfway there with something like
SELECT a.*, b.city as buyer_city FROM
table_1 a
JOIN table_2 b ON (a.buyer_id = b.person_id)
and then I could do a second query to get the seller. But is there any way to get what I want in a single query?