SQL分析函数练习:假设在任意4天内(不是最近4天),例如3号0点到7号23点59分 购买3次及以上 为 vip,求vip用户
-- 假设在任意4天内(不是最近4天),例如3号0点到7号23点59分 购买3次及以上 为 vip,求vip用户
SELECT DISTINCT T1.`user` from
(SELECT `user`,amount,time,rank() over (PARTITION by `user` ORDER BY time) rn FROM `records`) T1
INNER JOIN
(SELECT `user`,amount,time,rank() over (PARTITION by `us.
原创
2020-07-14 13:46:43 ·
252 阅读 ·
0 评论