欢迎投稿

今日深度:

oracle列递归累加sql代码实例,oracle递归累加sql

oracle列递归累加sql代码实例,oracle递归累加sql


查询压岁钱表age_money

select * from age_money;
year1 money
2001  10
2002  20
2003  20
2004  5
2005  10

递归累加

WITH T AS (
select year1,money from age_money where order by year1
)
SELECT T.year1,T.money, SUM(T.money) OVER(ORDER BY T.year1) as Recursion_Accumulate FROM T
year1 money RECURSION_ACCUMULATE
2001  10    10
2002  20    30
2003  20    50
2004  5     55
2005  10    65

www.htsjk.Com true http://www.htsjk.com/oracle/24026.html NewsArticle oracle列递归累加sql代码实例,oracle递归累加sql 查询压岁钱表age_money select * from age_money; year1 money2001 102002 202003 202004 52005 10 递归累加 WITH T AS (select year1,money from age_money where order by year1)S...
评论暂时关闭