我想重写旧的sql
select * from a, b, c where a.columnA = b.columnB and a.columnC *= c.columnD and a.columnE *= c.columnF
我尝试如下
select * from a join b on a.columnA = b.columnB left join c on a.columnC = c.columnD left join c on a.columnE = c.columnF
但是两条sql的结果不一样。 请帮忙。
将两个
left join
列合并为一个 left join
子句,例如:
select *
from a
join b
on a.columnA = b.columnB
left
join c
on a.columnC = c.columnD
and a.columnE = c.columnF