Oracle 12c offers a lot of fascinating new features – among them (at last) "FETCH FIRST n ROWS ONLY" syntax.
http://www.oracle-base.com/articles/12c/row-limiting-clause-for-top-n-queries-12cr1.php
Out of curiosity I’ve checked with 10053 event, the following query:
1 | select first_name, last_name, department_name |
2 | from employees e1, departments d |
3 | where e1.department_id=d.department_id |
4 | fetch first 10 rows only |
And this was the result 🙂
1 | SELECT "from$_subquery$_003"."FIRST_NAME" "FIRST_NAME", |
2 | "from$_subquery$_003"."LAST_NAME" "LAST_NAME", |
3 | "from$_subquery$_003"."DEPARTMENT_NAME" "DEPARTMENT_NAME" |
4 | FROM |
5 | (SELECT "E1"."FIRST_NAME" "FIRST_NAME", |
6 | "E1"."LAST_NAME" "LAST_NAME", |
7 | "D"."DEPARTMENT_NAME" "DEPARTMENT_NAME", |
8 | ROW_NUMBER() OVER ( ORDER BY NULL ) "rowlimit_$$_rownumber" |
9 | FROM "HR"."EMPLOYEES" "E1", |
10 | "HR"."DEPARTMENTS" "D" |
11 | WHERE "E1"."DEPARTMENT_ID"="D"."DEPARTMENT_ID" |
12 | ) "from$_subquery$_003" |
13 | WHERE "from$_subquery$_003"."rowlimit_$$_rownumber"<=10 |