• 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)