Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: MIN and MAX Query
In message <74a9c367.0302210204.6d5a5808_at_posting.google.com>, Thorsten
Kettner <thorsten.kettner_at_web.de> writes
>"Matty" <matt_at_slippeddisk.fsnenegspamt.co.uk> wrote in message
>news:<b33k4t$gsq$1_at_news8.svr.pol.co.uk>...
>
>Hi Matty,
>
>Mike's answer is correct. What error do you get?
>
>Here is the complete statement:
>
> select
> empno, ename, sal
> from
> emp
> where
> sal = (select max(sal) from emp) or
> sal = (select min(sal) from emp);
or just to tidy it up a tiny bit
select empno, ename, sal
from emp
where sal in (select min(sal),max(sal) from emp)
Cheers
-- MikeReceived on Fri Feb 21 2003 - 04:56:09 CST