with WorkView as (select 1 as ID,100 as Val,1 as Renban from dual
union select 1,100,2 from dual
union select 1,100,3 from dual
union select 1,100,4 from dual
union select 1,100,5 from dual
union select 1,200,1 from dual
union select 1,200,2 from dual
union select 1,200,3 from dual
union select 1,200,4 from dual
union select 1,300,1 from dual
union select 1,300,2 from dual
union select 1,300,3 from dual
union select 1,400,1 from dual
union select 1,400,2 from dual
union select 2,500,1 from dual
union select 2,500,2 from dual
union select 3,600,1 from dual
union select 3,600,2 from dual
union select 4,700,1 from dual
union select 4,700,2 from dual
union select 4,800,1 from dual
union select 4,900,1 from dual)
select ID,Val,Renban,
Row_Number() over(order by ID desc,Val,Renban desc) as Rank,
Row_Number() over(order by ID asc ,Val desc,Renban asc) as RevRank
from WorkView
order by ID desc,Val,Renban desc;