离散数据列(即数值列,非类型编号列)的数据排名情况sql
insert into xxx_dist
select -- 各项排名分类
user_id,
city_id,product_id product_cume_dist, -- 客户品牌
cust_level cust_level_cume_dist, -- VIP标识
round( CUME_DIST() OVER (PARTITION BY 1 ORDER BY user_score ) * 100 ) user_score_cume_dist, -- 剩余积分
round( CUME_DIST() OVER (PARTITION BY 1 ORDER BY fee_sum_6m/100 ) * 100 ) fee_sum_6m_cume_dist, -- 6个月平均ARPU(原单位为分)
round( CUME_DIST() OVER (PARTITION BY 1 ORDER BY data_bit/1024/1024/8 ) * 100 ) data_bit_cume_dist, -- 6个月月均数据流量(MB)
round( CUME_DIST() OVER (PARTITION BY 1 ORDER BY mail_logon_num + fetion_logon_num ) * 100 ) logon_cume_dist, -- 订购增值业务个数
round( CUME_DIST() OVER (PARTITION BY 1 ORDER BY fee_pay ) * 100 ) fee_pay_cume_dist, -- 近6个月平均每次交费金额
from xxxx
阅读(873) | 评论(0) | 转发(0) |