| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: How to identify a column in order by clause
Mr. Morgan,
10x for your long dump... without Oracle near at hand, I missmatched
the case with table aliases (if table alias present, you must use it
instead of table name to reference cols in ORDER BY clause, otherwise
Oracle complains):
SQL> SELECT ename, sal FROM emp WHERE ROWNUM < 2
2 ORDER BY emp.sal;
ENAME SAL
---------- ---------
SMITH 800
SQL> 1
1* SELECT ename, sal FROM emp WHERE ROWNUM < 2
SQL> c/emp/emp e
1* SELECT ename, sal FROM emp e WHERE ROWNUM < 2
SQL> 2
2* ORDER BY emp.sal
SQL> /
ORDER BY emp.sal
*
ERROR at line 2:
ORA-00904: invalid column name
Received on Fri Jan 07 2005 - 17:51:12 CST
![]() |
![]() |