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: Help needed: Oracle ans SQL

Re: Help needed: Oracle ans SQL

From: Alexei VORONOV <alexei_voronov_at_yahoo.com>
Date: Tue, 16 Oct 2001 14:21:04 +0200
Message-ID: <9qh8k3$o9v$1@wanadoo.fr>

select A.KEY, A.VALUE, A.LEV from <Your Table> A, (select KEY, max(LEV) F from <Your table> group by KEY) B
where A.KEY=B.KEY and A.LEV=B.F;

"Mirko Cegledi" <mcegledi_at_itprotect.de> a écrit dans le message news: 3BCBFE9A.B1964A20_at_itprotect.de...
> Hi!
>
> I've got a serious problem:
>
> I've got a table with key/value-pairs and an appropriate level. I'm
> searching for a query which results in a table that lists only the
> key/value-pairs with the greatest level.
>
> Example:
>
> key value level
> ---------------------
> name alice 1
> age 13 1
> name bob 2
> name cindy 3
> gender male 1
> age 15 2
>
> The query should have the following result:
>
> key value level
> ---------------------
> age 15 2
> gender male 2
> name cindy 3
>
> Can anybody help me?
>
> Mirko
Received on Tue Oct 16 2001 - 07:21:04 CDT

Original text of this message

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