级联报表查询
1 | A,2015-01,5 |
1 | select uid, month, amount, |
参考:
https://www.cnblogs.com/arjenlee/p/9692312.html#auto_id_81
留存
1 | ---dif = 0表示当日活跃 |
SQL 统计日环比、周同比
1
2
3select date,gmv,
lag(gmv,1) over(partition by type order by dt) as gmv1,
lag(gmv,7) over(partition by date order by dt) as gmv7 from tablue