On Tue, May 23, 2006 at 08:50:56AM +0200, A. Pagaltzis wrote:
> * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2006-05-23 02:35]:
> > What you have to do is:
> > 
> >    SELECT qi, ri, drl, score
> >      FROM ...
> >     WHERE score=(SELECT max(score) FROM ...)
> 
> Actually, in cases such as this, the easiest approach is to use
> `LIMIT`:
> 
>     SELECT qi, ri, drl, score
>     FROM ...
>     WHERE ...
>     ORDER BY score DESC
>     LIMIT 1

Only if "cases such as this" is defined as "datasets where only one record
has the maximum score" (which may be the case that Brannon presented -- I
don't recall offhand).  Otherwise, the two queries above are semantically
different and should reasonably be expected to return different results.

- Adrian

Reply via email to