orcale 查询多个字段 并根据某个字段去重

select * from (
select row_number()over(partition by xx order by id desc) as num,r.*
from tableName r
) a where a.num=1it