Let's suppose we have 2 tables.
First is for some ORDER: salesperson_id, customer_id, date, price... etc
Second is for people record PERSON: person_id, name, mail... etc
I need to select the order with both customer and salesperson names.
So row of records looks like this
order.order_id, order.date, name (for customer), name (for salesperson)
Yes you can - join the
person table twice but with different alias names.
select o.order_id, o.date, c.name as customer, s.name as sales_person from order_table o left join person_table c on c.id = o.customer_id left join person_table s on s.id = o.salesperson_id