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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Query resume

Author  Topic 

hjarami
Starting Member

1 Post

Posted - 2005-12-05 : 12:03:20
Hello:

I need a report showing the TOP 5 Salesman and an additional record showing the sum of the rest sales. Could I do it with a simple query?

Thanks for your help.

JorgeH

jhermiz

3564 Posts

Posted - 2005-12-05 : 13:38:50
No you can't, unless the first query is just returning amounts then you can perform a union.

Otherwise

SELECT TOP 5 blah FROM blah2 ORDER BY TheSale DESC

SELECT SalesMan, SUM(SALE) As TheSales FROM THETABLE GROUP BY TheSalesMan


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-12-06 : 00:35:36
Where do you want to show the data?
Are you using Reports?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -