Re: MIN and MAX Query

From: Ron Reidy <rereidy_at_indra.com>
Date: Wed, 19 Feb 2003 17:23:15 -0700
Message-ID: <3E541FF3.2010206_at_indra.com>


select max(sal), empno, ename
from emp
group by empno, ename
union
select min(sal), empno, ename
from emp
group by empno, ename
[Quoted] order by 1

--
Ron Reidy
Oracke DBA

Matty wrote:

> Hi All
>
> Just starting out making queries with SQL and have become stumped, and am
> looking for help!
>
> Table is called emp, with the following fields:
>
> EMPNO
> ENAME
> SAL
>
> I need to write a query to show the employees name and salary of the highest
> and lowest salary earner.
>
> I have worked it out to show the highest and lowest salaries but cannot get
> it together with the name!!
>
> I would appreciate your help here!
>
> Many thanks in advance
>
> Matty
>
>
Received on Thu Feb 20 2003 - 01:23:15 CET

Original text of this message