我正在做一些RFM
模型,被困在这里:
select "customer_id" as a, rfm_recency*100 + rfm_frequency*10 as rfm_combined
from
(select a,
ntile(4) over (order by recency) as rfm_recency,
ntile(4) over (order by frequency) as rfm_frequency) x
from
(select a,
max("purchase_date") as recency,
count(*) as frequency
from "customer") y
“ from”处或附近的语法错误
答案 0 :(得分:0)
我找到了答案:
select "customer_id" as a, rfm_recency*100 + rfm_frequency*10 as rfm_combined
from
(select a,
ntile(4) over (order by recency) as rfm_recency,
ntile(4) over (order by frequency) as rfm_frequency
from
(select a,
max("purchase_date") as recency,
count(*) as frequency
from "customer") x)y