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
 Transact-SQL (2000)
 Percent of Count from ROLLUP

Author  Topic 

blevy43
Starting Member

1 Post

Posted - 2008-09-24 : 10:42:22
There is WITH ROLLUP phrase in the GROUP BY clause which shows count summary value for all groups, for example:
SELECT VendorID, COUNT(*) as InvoiceCount
FROM Invoices
GROUP BY VendorID WITH ROLLUP

It is possible to add once more column in the result set with calculation of percent of Count value for each group from count summary value?

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-09-24 : 11:03:36
add as a seperate row the percent values by means of UNION ALL
Go to Top of Page
   

- Advertisement -