I want to do a ROLLUP on the Language column and generate the last row as a Total.
I am not sure where to put the ROLLUP.
For Eg:
AS
BEGIN
declare @sqlCommand NVARCHAR(4000) =
'SELECT Language, col2, col3, col4, Total = col2 + col3 + col4
FROM ( SELECT xL.lN, xS.sN, UC.UC
FROM (UC LEFT JOIN xL ON UC.Language = xL.xL) LEFT JOIN xS
ON UC.ssn = xS.ssn
WHERE
((DS BETWEEN .... AND ....) AND
(HS BETWEEN .... AND ....) AND
(MS BETWEEN .... AND ....))) UCs
PIVOT (SUM (UC) for sN IN
(col2, col3, col4))
AS PVT;';
EXEC SP_EXECUTESQL @sqlCommand
END