select X.sfzmhm
from X left join A
on X.sfzmhm = A.sfzmhm
left join B
on X.sfzmhm = B.sfzmhm and B.id>=1
left join C
on C.sfzmhm = X.sfzmhm
left join D
on D.sfzmhm = X.sfzmhm and D.hm=B.id
left join E
on A.mc = E.bh
left join F
on F.sn=C.sn and F.lx=B.id
用(+)代替:
select X.sfzmhm
from X left join A
on X.sfzmhm = A.sfzmhm(+)
left join B
on X.sfzmhm = B.sfzmhm(+) and B.id(+)>=1
left join C
on C.sfzmhm = X.sfzmhm(+)
left join D
on D.sfzmhm = X.sfzmhm(+) and D.hm=B.id(+)
left join E
on A.mc = E.bh
left join F
on F.sn=C.sn and F.lx=B.id