Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problem sorting results of a Union query passed to Oracle
<snip>
>use positional order by's with unions. for example, if login_timestamp is
the
>1'st column in the "*" (btw: it can be deadly to do a select "*" in a
program --
>you really should select c1, c2, c3, ... and so on) then you would "order
by 1"
>Thomas Kyte tkyte_at_us.oracle.com
1 (select * from emp where empno=7934
2 union
3 select * from emp where empno=7902)
4* order by 1
SQL> /
EMPNO ENAME JOB MGR HIREDATE SAL COMM
--------- ---------- --------- --------- --------- --------- --------- 7902 FORD ANALYST 7566 03-DEC-81 3000 7934 MILLER CLERK 7782 23-JAN-82 1300
True :-)
M Received on Mon Jun 21 1999 - 10:31:48 CDT
![]() |
![]() |