select * from (select row_number() over(partition by 以此字段为分组 order by 以此字段排序 desc rn
from dual) where rn=1 --表示取第一个
如:
id date
1 11/04
1 11/08
1 11/12
2 11/03
2 11/01
结果
id date
1 11/12
2 11/03
SQL
select * from (select row_number() over(partition by id order by date desc rn
from dual) where rn=1