Execution Order in case of Rownum
Hi All,
I just wanted to know how the query will be executed in case of where clause and ROWNUM clause. e.g, consider below query.
SELECT * FROM emp
WHERE dept IN (20, 30, 21)
AND salary < 10000
AND rownum <2;
My question is that when rownum will be executed?
1. First all the data according to where clause will be fetched and rownum is asigned and then rownum will be executed on that data.
2. First complete data will be fetched, ROWNUM will be applied and then WHERE clause will be executed along with ROWNUM clause.
Regards,
Vikas Kumar