给你一个用sql的(注:须oracle816以上),在sqlplus环境中运行
例如:有表 Table(A,B,C)
select A,B,C from (select A,B,C,dense_rank() over(order by &col) as id from Table) where id=&seq若用PL/SQL的话,要用动态SQL。