Top 10 query not working

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

Douglas J. Steele

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top