[지표] 구매구간대 별 고객수

yozzum·2025년 2월 28일

SQL

목록 보기
34/36

select case when amount between 0 and 1 then '0~1'
when amount between 1 and 2 then '1~2'
else '2~'
end as 'amount_range'
,count(distinct customer_id) as customer_count
,sum(amount) as total_amount
from payment
group by amount_range;

profile
yozzum

0개의 댓글