Hi,

...
>  I'm still a newbie in mysql and also sql statements.
>  I was wondering if some one can help me with this problem.
>
>  I'm trying to select 5 of the highest values from a
>  table. But i can't seem to find any help from the
>  manual and also some other books. In the manual,
>  there is only a function to find the highest(max) value.
>
>  Do i need to make a new function??

SELECT * FROM table Where whateever order by DESC limit 5;

Note that is not fast, because MySQL must sort the whole result before
returning 5 rows. So make the "where whatever" so narow as you can.

// Jarmo


---------------------------------------------------------------------
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

  • _ Markus Siagian

Reply via email to