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: Glen E. Siferd <siferd_at_admin.uwex.edu>
Date: Tue, 4 May 1999 07:50:13 -0500
Message-ID: <7gmqe4$117i$1@news.doit.wisc.edu>


This looks like the right solution, plus you could put the sum(sal) back in the first line to get both elements in your output.

Geoff White <whiteg_at_ccis.adisys.com.au> wrote in message news:372E5262.6A820D3D_at_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 Tue May 04 1999 - 07:50:13 CDT

Original text of this message

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