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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Simple SQL question...

Re: Simple SQL question...

From: Geoff White <whiteg_at_ccis.adisys.com.au>
Date: Tue, 04 May 1999 09:50:26 +0800
Message-ID: <372E5262.6A820D3D@ccis.adisys.com.au>


This did the job when I tested it on my temp table

select deptno
from t1
group by deptno
having sum(sal) = (
select max(sum(sal))
from t1
group by deptno)
/

HTH Geoff

notronrj_at_my-dejanews.com wrote:

> Hello,
>
> Got a SQL question. I think it's a simple one, but I am fairly new
> at SQL. I just took the Intro to SQL from Oracle Education.
>
> I have a table "EMP" that contains employess, dept number and salary and
> other info.
>
> I want to write a query that returns the dept with the highest combined
> salary.
>

<snip> Received on Mon May 03 1999 - 20:50:26 CDT

Original text of this message

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