Código SQL:
Ver originalSELECT isnull(SUM([1996]),0) AS [1996],isnull(SUM([1997]),0) AS [1997],isnull(SUM([1998]),0) AS [1998],shipcountry FROM
(
SELECT
CASE WHEN datepart(yyyy,OrderDate)=1996 THEN SUM(total) END AS [1996],
CASE WHEN datepart(yyyy,OrderDate)=1997 THEN SUM(total) END AS [1997],
CASE WHEN datepart(yyyy,OrderDate)=1998 THEN SUM(total) END AS [1998],
ShipCountry
FROM(
SELECT
OrderDate,(UnitPrice * Quantity) AS total, ShipCountry
FROM [ORDER Details] AS t1
LEFT JOIN Orders AS t2 ON (t1.OrderID=t2.OrderID)
) AS t1
GROUP BY ShipCountry,orderdate
) AS t2 GROUP BY ShipCountry
saludos!