Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Get 10 highest values in recordset


Message #1 by "Nick" <nikosdra@l...> on Fri, 6 Apr 2001 15:54:55
You can use the TOP modifier.

Here is an example:

SELECT Top 10 ID, Field2, Field3 FROM myTable ORDER BY ID DESC

The field you are ordering by determines the field you want to "top". If 
you don't specify the ORDER BY clause, the results are unpredictable.


Hope this helps,

Imar


At 03:54 PM 4/6/2001 +0000, you wrote:
>Hi all,
>
>I have a recordset of more than 500 records and all i want to display is
>only the 10 highest (or lowest) values of a specific field. Can anyone
>help on the syntax of my query??
>
>Thanks in advance
>
>Nick


  Return to Index