SELECT 时间, SUM(现金收入) OVER (ORDER BY 时间) AS 累计现金, SUM(银行收入) OVER (ORDER BY 时间) AS 累计银行, SUM(现金收入 + 银行收入 - 现金支出 - 银行支出) OVER (ORDER BY 时间) AS 累计余额 FROM 日报 WHERE 时间 > '2023-08-30' AND itemid = 'aca15c09-ee93-494c-9fb2-d440e3ae5738' 这个公式累加只能累加库里有数据的日期,我想如果库里这一天没有数据,就按照+0累加,可以怎么实现, |
最佳回答 |
||||
0
|
|