Posted by: Khairey May 3, 2010
SQL server roll-up function help
Login in to Rate this Post:     0       ?        
my bad, how can I make sum on category  when it is nvarchar!!! :) I should have used count :)


select category, count(category) as CategoryTotal , sum (children) as SubTotal from mytable group by category;

----
assuming children is integer. Does it work? If not, what does it actually result?

Read Full Discussion Thread for this article