Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: tricky SQL question
You could define an inline view. Your query would contain an implicit view
with a union:
select * from ( select * from a union select * from b ) where id = 5;
If you wanted to, with oracle 8.1.6 (unfortunately ONLY 8.1.6.....) you
could even use a order by in your implicit view. This is very handy, for
example if you wanted to select the 3 top earning employees in the EMP table
you could say:
select * from ( select ename, sal from emp order by sal desc ) where rownum
<= 3;
I'd like to see anyone do this quick and dirty in Oracle 7.3!
Greetings,
Bastiaan Received on Thu May 04 2000 - 00:00:00 CDT
![]() |
![]() |