I have the following table:
CREATE table prd ( prdid varchar(10) ) insert into prd values (\'prd1011\'),(\'prd1023\'),(\'prd4532\'),(\'prd2341\')
I tried this and it worked but it is working only if the prdid column is unique:
select prdid, (select COUNT(*) from prd p where p.prdid >= r.prdid)rnk from prd r order by rnk