count top a few records

  • Thread starter Thread starter sg
  • Start date Start date
S

sg

Hi,

I'm trying to create a query to only show top 10 sales account information
sorted by sales descendingly.
account, name, sales.
How can I do this? I tried having count("account")=10 , it doesn't work.

Thanks in advance,
Sarah
 
sg said:
I'm trying to create a query to only show top 10 sales account information
sorted by sales descendingly.
account, name, sales.
How can I do this? I tried having count("account")=10 , it doesn't work.


You can use the TOP predicate to do this (except that it
will include ties).

SELECT TOP 10 account, name, sales
FROM the table
ORDER BY sales DESC
 
Back
Top