WITH t1 AS
(
SELECT 1822218 cnt
)
, t2 AS
(
SELECT 1 seq ,0 start ,100000 ends ,5 cals
UNION ALL SELECT 2 , 100001, 300000, 4.8
UNION ALL SELECT 3, 300001, 1000000 ,4.6
UNION ALL SELECT 4, 1000001, 2000000 ,4.4
UNION ALL SELECT 5, 2000001 ,5000000, 4.2
UNION ALL SELECT 6, 5000001 ,99999999999, 4.2
)
=100000*5+200000*4.8+700000*4.6+(1822218-1000000)*4.4
=500000+960000+3220000+3617759 =8297759 가 나와야 한다는데
마농님이 알려주신 쿼리를 어떻게 변형해야 하는지 ㅠ.ㅠ
길이 너무 머네요 ㅠ.ㅠ
|