Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

max function?

Status
Not open for further replies.

poolshark8or9

Technical User
Jan 20, 2005
4
US
i am counting the total number of orders for each customer, but i only want it to return the top 100 customers, the customer with the most orders, down to the customer with the 100th most orders.
How can i do this?
Thanks in advance.
 
Does your database support OLAP functions ? If so, you can use functions like rank(), dense_rank or row_number().
 
ask in the sybase forum, because many dbms have a function or clause which is not sql standart but serve this purpose well.


Juliane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top