Sep 3, 2001 #1 d3c3as3d MIS Sep 3, 2001 2 AU Would anyone tell me how you would rank a records in (as/400) db2 product prct_count rank OR rank aaa 99 1 4 bbb 50 2 2 eee 50 2 2 ccc 20 4 1 Thank in advance
Would anyone tell me how you would rank a records in (as/400) db2 product prct_count rank OR rank aaa 99 1 4 bbb 50 2 2 eee 50 2 2 ccc 20 4 1 Thank in advance
Sep 4, 2001 #2 Farab Programmer Mar 20, 2001 60 GB select product, prct_count, rank() over(order by prct_count desc) as product_rank from rank_test order by product_rank If you want to rank it in reverse order, then change the (order by prct_count desc) to (order by prct_count asc). This should to the trick. Upvote 0 Downvote
select product, prct_count, rank() over(order by prct_count desc) as product_rank from rank_test order by product_rank If you want to rank it in reverse order, then change the (order by prct_count desc) to (order by prct_count asc). This should to the trick.