select uid, date_format(dt,"%Y%m") `month`, sum(get_coin_num) coin from(select uid, dt, date_sub(dt,interval rk-1 day) start_date, case(dense_rank() o...