SELECT * FROM
(
SELECT
State,
--Program,
Id,
case
when program like '%Junior%' then 'Junior'
when program like '%Senior%' then 'Senior'
when program like '%Daughters and Dads%' then 'Daughters and Dads'
when program like '%WWCF%' then 'WWCF'
when program like '%Program%' then 'All Program'
End as Program
from table_1
where state is not null
) g
PIVOT (
count(Id) FOR
Program in ([Junior], [Senior], [Daughters and Dads], [CRICKET_BLAST], [WWCF], [All Program])
)AS pvt
using above query I am getting the below output which is correct.
enter image description here
but I am looking for below output, want to add one extra row which will give sum of columns data.
enter image description here
I tried union and CTE but that is not working for me.