<gh_stars>0
select cal_dt as bb , sum(price) as aa from test_kylin_fact fact
inner join (


select count(1) as cnt, min(cal_dt) as "mmm",  cal_dt as dt from test_kylin_fact group by cal_dt order by 2 desc limit 10


) t0 on (fact.cal_dt = t0.dt) group by cal_dt