es mas simple de esta manera ;):
Código SQL:
Ver originalSELECT grupo, SUM(plazo1),SUM(plazo2),SUM(plazo3) FROM
(
SELECT CASE WHEN plazo='Plazo 1' THEN SUM(isnull(Nominal,0)) END AS plazo1,
CASE WHEN plazo='Plazo 2' THEN SUM(isnull(Nominal,0)) END AS plazo2,
CASE WHEN plazo='Plazo 3' THEN SUM(isnull(Nominal,0)) END AS plazo3,grupo, plazp FROM
(
SELECT [Grupo],
SUM([Nominal]) AS Nominal,
CASE WHEN [Plazo] = '1M' THEN 'Plazo 1' WHEN [Plazo] = '3M' THEN 'Plazo 2' WHEN [Plazo] = '6M' THEN 'Plazo 3' END AS Plazo
FROM [TABLA]
GROUP BY [Grupo], Plazo
) AS t1 GROUP BY grupo, plazo
AS t2 GROUP BY grupo)