SELECT case
when user_grade = 'basic' then image_price * buy_count
when user_grade = 'bronze' then image_price * buy_count + ( product_price * 0.03 )
when user_grade = 'silver' then image_price * buy_count + ( product_price * 0.05 )
when user_grade = 'gold' then image_price * buy_count + ( product_price * 0.1 )
when user_grade = 'premium' then image_price * buy_count + ( product_price * 1 )
else image_price * buy_count end
FROM 테이블명
WHERE user_idx = '44'
이 결과의 합을 구하고싶은데요....도움좀 부탁드립니다.
|