如果是三张表,将上图红色的部分看作一个C,与D进行交集。
内连接使用inner join
select * from TableC C inner join (select * from TableA A right join TableB B on A.key = B.key where A.key is null) D on C.key = D.key
如果是三张表,将上图红色的部分看作一个C,与D进行交集。
内连接使用inner join
select * from TableC C inner join (select * from TableA A right join TableB B on A.key = B.key where A.key is null) D on C.key = D.key
本文标题:SQL多表查询(一张图超神)
本文链接:https://www.haomeiwen.com/subject/iespjltx.html
网友评论