select m.Flot,n.Fop,(select nvl(sum(Fqty),0) from A where Flot=m.Flot and Fop=n.Fop) Fqty from (select distinct Flot from D) m,(select distinct C.Fop from D,B,C where D.Flot=B.Flot and B.Froute=C.Froute) n
调试欢乐多
select x.flot, x.fop, nvl (sum (a.fqty)) sumfqty
from (select b.flot, c.fop
from b, c
where b.froute = c.froute) x, a
where x.flot = a.flot(+) and x.fop = a.fop(+);