select max(rating) from singlemalts will give you the highest value

or

select * from singlemalts order by rating desc
will give all the rows ordered by rating and the first row will have the 
highest value

Richard Reina wrote:

> I've tried the manual (and the Oreily MySQL book) and played around with
> MAX() and GREATEST() but could not figure it out.
> 
> 
> |ID   |NAME           |RATING |
> |213  |McCallen 12    |   9   |
> |214  |Glenmorangie   |   8   |
> |225  |Glenlevit      |   7   |
> 
> How do I select the one with highest rating without knowing what the
> highest rating is.
> 
> SELECT ID, NAME, RATING 
> FROM SINGLEMALTS
> WHERE RATING ????
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
> 
> 
> 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to