Top 10 query not working

  • Thread starter Thread starter steve.allen75
  • Start date Start date
S

steve.allen75

Hi,

I have a query that when I run it finds 45 records of which there are
15
uniques results.

If I then make it a Top 10 query it returns 11 records, but only 7
unique
results.

My SQL is below. The bizarre thing is that it works fine for
performing the
Top x query on other fields with my table.

Are any known scenarios when the Top x query isn't reliable?

Thanks

SELECT TOP 10 newtable.Rootcause, Count(newtable.Rootcause) AS Vol
FROM newtable
GROUP BY newtable.Rootcause
ORDER BY Count(newtable.Rootcause) DESC;
 
From the Help file:

"The TOP predicate doesn't choose between equal values. In the preceding
example, if the twenty-fifth and twenty-sixth highest grade point averages
are the same, the query will return 26 records."
 
Back
Top