2022-12-30
阅读量:
682
mysql 学习54--用户价值分析之每个用户消费时间间隔、消费频次、消费金额
-- 4.用户价值分析
-- 4.1 每个用户消费时间间隔、消费频次、消费金额
select
user_id,
max(日期) as 最近一次消费时间,
timestampdiff(day,max(日期),'2014-12-19') as R,
count(*) as F,
sum(amount) as M
from userbehavior_new
where behavior_type='buy'
group by user_id;






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
0条评论