CDA持证人阿涛哥

2022-12-30   阅读量: 347

Mysql

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;


514.2857 3 0 关注作者 收藏

评论(0)


暂无数据

推荐课程

推荐帖子