tienes razón
Código SQL:
Ver originalSELECT SUM(t1.s), t1.id_empresa FROM (
SELECT COUNT(m.id_monitoreo)AS s, ca.id_caracteristica,ca.cv_caracteristica,c.id_emp resa FROM tbl_monitoreo m
INNER JOIN cat_empresa c ON (m.id_empresa = c.id_empresa)
INNER JOIN tbl_caractrevper p ON (p.id_tipomedio = m.id_tipomedio AND p.id_medio = m.id_medio)
INNER JOIN cat_tipomedio tm ON (m.id_tipomedio = tm.id_tipomedio)
INNER JOIN cat_caracteristica ca ON (m.id_caracteristica = ca.id_caracteristica)
WHERE m.id_ciudad =1 AND m.d_fechacaptura >= '2009-10-01' AND m.d_fechacaptura <= '2010-01-01' AND m.id_empresa = 3 AND m.id_caracteristica = 1
GROUP BY ca.id_caracteristica,ca.cv_caracteristica,c.id_emp resa
UNION
SELECT COUNT(m.id_monitoreo) AS s, ca.id_caracteristica,ca.cv_caracteristica, c.id_empresa FROM tbl_monitoreointernet m
INNER JOIN cat_empresa c ON (m.id_empresa = c.id_empresa) INNER JOIN cat_tipomedio tm ON (m.id_tipomedio = tm.id_tipomedio)
INNER JOIN cat_caracteristica ca ON (m.id_caracteristica = ca.id_caracteristica) WHERE m.id_ciudad=1 AND m.d_fechacaptura >= '2009-10-01'
AND m.d_fechacaptura <= '2010-01-01' AND m.id_empresa = 3 AND m.id_caracteristica = 1
GROUP BY ca.id_caracteristica,ca.cv_caracteristica,c.id_empresa
) AS t1 GROUP BY t1.idempresa;