ROWNUM IN ORACLE
nOTE : [ reference :http://blog.lishman.com/2008/03/rownum.html] ROWNUM is an Oracle pseudo column which numbers the rows in a result set. SELECT rownum, table_name FROM user_tables; ROWNUM TABLE_NAME ------------- ----------------- 1 EMP 2 DEPT 3 BONUS 4 SALGRADE 5 DUMMY 5 rows selected Here is a summary of how ROWNUM can be used. Limiting Rows ROWNUM can be used to limit the number of rows returned by a query in a similar way to LIMIT in Postgres and MySql, TOP in SQL Server and FETCH FIRST in DB2. SELECT rownum, table_name FROM user_tables WHERE rownum <=3; ROWNUM TABLE_NAME ------------- ----------------- 1 EMP 2 DEPT 3 BONUS 3 rows selected ROWNUM with DML The use of ROWNUM is not restricted to select statements. It can be used with DML stateme...