我在 SlamData 中使用了查询功能。我的代码:
SELECT
DATE_PART("year",thedate) AS year,DATE_PART("month",thedate) AS month,
SUM(runningPnL) AS PnL
FROM "/Mickey/testdb/sampledata3" AS c
GROUP BY DATE_PART("year", thedate) ,DATE_PART("month", thedate)
order by DATE_PART("year", thedate) ,DATE_PART("month", thedate)
我的表的摘录:
PnL month year
-1651.8752 1 2001
17180.4776 2 2001
48207.54560000001 3 2001
现在,我怎样才能找到 PnL 的累积总和?
例如。-1651.8752
第一个月
15528.6024
第二个月
非常感谢>.<