To retrieve rows X to Y from a table I am using the following query
1)SELECT *
FROM
(SELECT rownum cn,empno,ename,sal
FROM emp
WHERE rownum < &x) a
WHERE a.cn > &y
It is working fine. In its place if I use the following query it is throwing error message.
2)SELECT *
FROM
(SELECT rownum ,empno,ename,sal
FROM emp
WHERE rownum < &x) a
WHERE a.rownum > &y
It is throughing error message
ORA 01747 Invalid column spectification.
Could any one please suggest what is wrong with second query?