Problem with the SELECT TOP x statement (1 Viewer)

keving

Registered User.
Local time
Today, 08:32
Joined
Feb 28, 2003
Messages
23
I am using the SELECT TOP 3 statement to select the top 3 values from a given data field. The SELECT works great, as long as there are no duplicate values in the TOP 3 values. For example if the top 3 values are 210, 202 & 199 they are selected correctly but if there three records that have the 199 value I am selecting 210, 202, 199, 199 and 199. Is there a way to only select the first 3 top values, i.e. the first three encountered?

Thanks Kevin ....
 

jaxhere

Registered User.
Local time
Today, 04:32
Joined
Mar 6, 2007
Messages
13
I'm not sure if this would work, but it seems to me that you might try doing a previous query where you'd use the DISTINCT operator to select unique values, then do your SELECT TOP 3 query on the results of the previous query.
 

Users who are viewing this thread

Top Bottom