Join 3 tables in sql server

I have three tables in sql server like table A Table B table C.

How can I join 3 tables as shown in the image below?

enter image description here

+3


source to share


1 answer


Additional info needed to get the correct piece of code, but from the image you need LEFT JOIN s.

(id was assumed)



SELECT *
FROM Customers c
LEFT JOIN Items i ON c.iid = i.id
LEFT JOIN Sales s ON c.sid = s.id

      

+5


source







All Articles