下面的查询给了我两列的输出:
Day Num_Users_Retained
0 209312
1 22139
2 11457
依此类推,一直到 259(2012 年的每一天)..但是我希望第 0 天包含 num_users_retained 中从 0 到 259 的所有值的总和...然后我希望第 1 天包含从 1 到 259 的所有值的总和,依此类推,直到我到达最后一天。这是原始查询:
--Retention since January 1,2012--
select retention as Day,count(retention) as Num_Users_Retained
from (select player_id,round(init_dtime-create_dtime,0) as retention
from player
where Trunc(Create_Dtime) >= To_Date('2012-jan-01','yyyy-mon-dd')
and init_dtime is not null)
Group by retention
order by 1
有什么建议么?