I have the following table:
CREATE table prd ( prdid varchar(10) ) insert into prd values (\'prd1011\'),(\'prd1023\'),(\'prd4532\'),(\'prd2341\')
select *, ( select count(*) from prd p2 where p1.prdid >= p2.prdid ) as cnt from prd p1