Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: tricky SQL question

Re: tricky SQL question

From: Bastiaan Schaap <bschaap_at_desyde.nl>
Date: 2000/05/04
Message-ID: <UK9Q4.2$uz6.163@psinet-eu-nl>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US