1.最好:select t.code,t.name,sum(nvl(s.unit_price,0)*nvl(s.qty,0)) as ttlmoney
from tbl_father t,tbl_son s
where t.id = s.id
group by t.code,t.name

解决方案 »

  1.   

    select code,name,ttlmoney,count(*) over(order by rownum) amount from 
    (select t.code,t.name,sum(s.unit_price*s.qty) as ttlmoney
    from tbl_father t,tbl_son s
    where t.id = s.id
    group by t.code,t.name)
      

  2.   

    over(order by rownum) 是什么意思啊?
      

  3.   

    select code,name (select t.code,t.name,sum(s.unit_price*s.qty) as ttlmoney
    from tbl_father t,tbl_son s
    where t.id = s.id
    group by t.code,t.name)