@七步、:你只要学会这样写SQL就没有问题了。
Select a.*, b.x, c.y from a
left outer join (Select * from tablex where condition1)b
on a.id=b.id
left outer join (Select * from tabley where condition2)c
on a.id=c.id
where condition3
本文介绍了一种使用SQL进行复杂查询的方法,重点讲解了如何通过两次左外连接实现多表关联查询。具体步骤包括:首先从主表选取所有记录,然后分别与两个子表进行左外连接,并设置相应的连接条件。
@七步、:你只要学会这样写SQL就没有问题了。
Select a.*, b.x, c.y from a
left outer join (Select * from tablex where condition1)b
on a.id=b.id
left outer join (Select * from tabley where condition2)c
on a.id=c.id
where condition3
1570
2063
9903

被折叠的 条评论
为什么被折叠?