SQL Query [message #103332] |
Thu, 12 June 2003 23:29 |
Vibhu Bahl
Messages: 1 Registered: June 2003
|
Junior Member |
|
|
I am unable to get the logic behind these two queries.
Answers should have been same logically but Oracle gives different results with these two queries.
Please explain.
Queries :
SQL> select ename from emp where rownum in (1,2);
ENAME
----------
JAMES
ALBERT
SQL> select ename from emp where rownum in (select rownum from emp where rownum in (1,2));
ENAME
----------
JAMES
JAMES
Thanks,
Vibhu Bahl
|
|
|