简体   繁体   中英

Joining 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 expressed in the image below?

在此处输入图片说明

More information needed to give you a correct piece of code, but from the image you need LEFT JOIN s.

(ID's have been presumed)

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

It's never too late :)

Most probably you'll need this:

select ...
  from customers
  full outer join (items inner join sales on (xxx)) on (xxx)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM