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: [Q]SQL Question

Re: [Q]SQL Question

From: John Durst <jdurst_at_sky.net>
Date: 1998/09/29
Message-ID: <3611AEE1.89AE7014@sky.net>#1/1

How about select dep, max(salary)-min(salary) difference from table group by dep;

Ng K C Paul wrote:

> I have a table like this:
>
> dep emp salary
> --- --- ------
> 10 1 100
> 10 2 150
> 20 1 220
> 20 2 330
> 30 1 500
> 30 2 600
>
> I want the result like this:
>
> dep difference
> --- ----------
> 10 50
> 20 110
> 30 100
>
> How can I select the result using SQL?
Received on Tue Sep 29 1998 - 00:00:00 CDT

Original text of this message

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