select a.*标签:01,num,update,PGSQL,最新,tm,indicators,select,重取 From: https://blog.51cto.com/u_14650780/5998686
,to_date(to_char(a.update_tm,'YYYY-01-01'),'YYYY-01-01') as 年份
from
(select department,name,indicators_num,occurrences_num,update_tm,(select max(write_date) from plan_repair_operational_indicators_info) as max_date from plan_repair_operational_indicators_info group by department,name,indicators_num,occurrences_num,update_tm ORDER BY department)
as a where a.update_tm=(select max(update_tm) from plan_repair_operational_indicators_info)