Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL conditional aggregation...
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