select top 10

S

stacie

How can I write a query to select the top 10 items most used? I have a
database with a list of patients and their diagnosis and I want to know the
top 10 diagnosis used in the table.
 
R

raskew via AccessMonster.com

Here's an example, using Northwind's Orders table, which returns the top 10
employees by count of orders per employee. You should be able to convert it
to your requirements:

SELECT TOP 10 Orders.EmployeeID, Count(Orders.RequiredDate) AS
CountOfRequiredDate
FROM Orders
GROUP BY Orders.EmployeeID
ORDER BY Count(Orders.RequiredDate) DESC;

HTH - Bob
 

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