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 conditional aggregation...

Re: SQL conditional aggregation...

From: Ralf Jonas <scraponly_at_hotmail.com>
Date: Fri, 22 Aug 2003 13:14:24 +0200
Message-ID: <bi4ttp$56hps$1@ID-6634.news.uni-berlin.de>


Hi,

> Now I need to show the "Best Match" the name
> for which the SCORE is the highest grouping by
> ENTITY_ID e.g.
>
> "El puli en la Habana" with 98

select entity_id, name, score from ...

   where (entity_id, score) in (select entity_id, max(score) from ...    group by entity_id);

HTH Ralf Received on Fri Aug 22 2003 - 06:14:24 CDT

Original text of this message

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