Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
spmchugh82
Starting Member
13 Posts |
Posted - 2009-03-20 : 14:06:09
|
I have an invoice table:INVOICE-------IDInvoiceNumberSalespersonProductQuantityHow would I return the how many items each person has sold and have it ordered by the top seller first?Thank you so much! |
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-03-20 : 14:11:31
|
select Salesperson, count(*) invoices from Invoice group by Salesperson order by count(*) desc, Salesperson |
 |
|
spmchugh82
Starting Member
13 Posts |
Posted - 2009-03-20 : 17:21:18
|
This worked, thank you! |
 |
|
|
|
|