For every value in ColA: We need to sort ColB and ColC, then assign a Rank value as shown in the picture.
There is an additional logic here, After we sort ColB and ColC, If the value in ColC is lower than the above below value, then we need to reset the Rank value to 1.
with tab(colA,colB,colC) as (
select x, 1, 10 from dual union all
select x, 2, 12 from dual union all
select x, 3, 14 from dual union all
select x, 4, 111 from dual union all
select x, 5, 120 from dual union all
select x, 6, 150 from dual union all
select x, 7, 0 from dual union all
select x, 8, 1 from dual union all
select x, 9, 2 from dual union all
select y, 1, 11 from dual union all
select y, 2, 12 from dual union all
select y, 3, 13 from dual union all
select y, 4, 1 from dual union all
select y, 5, 3 from dual union all
select y, 6, 4 from dual union all
select y, 7, 5 from dual union all
)