不知道你的data_time是什么格式的,暂时理解为varchar2格式。select mon_day,index_id,avg(val) from(select trunc(to_date(data_time,'yyyy-mm-dd'),'iw') mon_day,index_id,val from table) group by mon_day,index_id