Home Forums SQL Server 2008 T-SQL (SS2K8) Query help to find total RE: Query help to find total
rxm119528
SSCrazy
Points: 2960
More actions
September 15, 2014 at 8:01 am
#1745488
declare @rollup table(
id int,
cnt int)
insert into @rollup values(339,15),(340,5),(341,2)
select isnull(cast(id as varchar(12)),'Total'),SUM(cnt) from @rollup
group by rollup(id)