Oracle left查询案例

select ano,sum(nvl(dmoney,0)) summoney
from(
 select t2.ano,d.dmoney
 from (
    select t1.*,c.cno
    from(
      select a.ano,b.bno
      from t_a a left join t_b b on a.ano=b.ano
    )t1 left join t_c c on t1.bno=c.bno
  )t2 left join t_d d on t2.cno=d.cno
)group by ano;

 

posted @ 2015-01-21 21:13  yshy  阅读(1221)  评论(0编辑  收藏  举报