Prueba asi:
Código SQL:
Ver originalSELECT YEAR,
CASE mes
WHEN 12 THEN 'Diciembre'
WHEN 1 THEN 'Enero'
WHEN 2 THEN 'Febrero'
END AS mes,
SUM(prima_us_PC) AS prima_us_PC, SUM(prima_us_BU) AS prima_us_BU
FROM (
SELECT YEAR,mes, SUM(prima_us) AS prima_us_PC, SUM(0) AS prima_us_BU
FROM produ_comercial
WHERE manager = 'L' AND cia ='000169'
AND ((mes = 12 AND YEAR IN (2008,2009)) OR (mes IN (1,2) AND YEAR IN (2009,2010)))
GROUP BY YEAR,mes
UNION
SELECT YEAR,mes, SUM(0), SUM(prima_us)
FROM tbl_budget
AND ((mes = 12 AND YEAR IN (2008,2009)) OR (mes IN (1,2) AND YEAR IN (2009,2010)))
GROUP BY YEAR,mes
) a
GROUP BY YEAR,mes