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: SQL*PLUS question

Re: SQL*PLUS question

From: Steven Franklin <steven.franklin_at_mci.com>
Date: Thu, 18 Mar 1999 13:26:22 GMT
Message-ID: <36F0FF4B.478D32DE@mci.com>


I Think the question here is how to find a MEDIAN value not an AVERAGE.

Emmanuel Bontemps wrote:

> select group_id, avg(rate)
> from table_a
> group by group_id;
>
> Hemei a écrit :
> >
> > I have one table, table_a which has two attributes group_id and rate. What I
> > want is to retrieve the medium value for each group_id. For example,
> > table_a:
> > group_id rate
> > ------------ ------
> > 01 1.0
> > 01 1.1
> > 01 1.2
> > 02 2.1
> > 03 3.1
> > 03 3.4
> > 03 4.0
> > 03 4.1
> > 03 5.0
> > what I want is something like:
> > group_id rate
> > ------------ ------
> > 01 1.1
> > 02 2.1
> > 03 4.0
> > Is there a easy way to do this with sql*plus? Thanks.
> >
> > Peng Nie
Received on Thu Mar 18 1999 - 07:26:22 CST

Original text of this message

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