select * from
(
select FUNCTIONAL_LOCATION,HDR_END_DATE,row_number()
over(partition by FUNCTIONAL_LOCATION order by HDR_END_DATE ) mm
from T_EODB_CONTRACT_ITM_DEL) as t
where t.mm=1;
试试这样行不行