Posted by: panacea May 4, 2010
SQL server roll-up function help
Login in to Rate this Post:     0       ?        
If something like this works then use the following query. I am not sure if it works in SqlServer.
Try to go through Analytical Functions, it will make jobs like this a lot easier. Thanks.



select id,name,
category,count(*) over (partition by category ) categroy_total_count,
children
from test1
order by id;

Read Full Discussion Thread for this article