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: SQL Question

Re: SQL Question

From: T Suresh kumar <sureshkt_at_hotmail.com>
Date: Mon, 27 Apr 1998 19:15:02 +0530
Message-ID: <35448BDD.50F2953A@hotmail.com>


Hai try this

    select x.cola , x.colb
    from x , (select cola, max(colc) colc from x group by cola) b     where x.colc = b.colc
    and x.cola = b.cola

Regards
Suresh Kumar

Lui Yuan Tze wrote:

> Hi,
> suppose I have the following table:
> table X with
> col A col B col C
> xx y 99
> xx t 100
> yy a 10
> yy d 30
> yy e 5
>
> How do I code SQL to get the values of col A and col B of the
> max col C value for each col A ? ie record no 2 and no 4.
>
> Thanks ahead
Received on Mon Apr 27 1998 - 08:45:02 CDT

Original text of this message

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