Oracle行結(jié)果合計(jì)的實(shí)現(xiàn),,主要應(yīng)用于日期結(jié)果的集計(jì),下面是具體的實(shí)現(xiàn)代碼,。 With AA as ( select 'A' tNo , 10 B from dual union select 'B' , 20 from dual union ) select tNo , sum(B) over (partition by B order by B rows unbounded preceding) sumsal from AA
備注 還可以有rows 2 preceding的寫法,,就是集計(jì)到第五行。 |
|