取每个task_id分组中更新日期最新的一行
采用join的方式完成
select a.task_id,a.theme_id,a.time_unix
from table_xxx a
join (select task_id,max(time_unix) as max_timefrom table_xxxwhere date <= '${date}'and date >= '${date}' - 3and theme_id > 0group bytask_id) b
on date <= '${date}'
and date >= '${date}' -3
and a.task_id = b.task_id
and a.time_unix = b.max_time
) t2