I would like to generate a line number for each line in the results of a sql query. How is it possible to do that?
Example: In the request
select di
In Oracle
SQL> select row_number() over (order by deptno) as rn 2 , deptno 3 from 4 ( select distinct deptno 5 from emp 6 ) 7 / RN DEPTNO ---------- ---------- 1 10 2 20 3 30 SQL>