[UNION ALL] select a,b,sum(sm) AS s1, SUM(qm) AS s2 from ( select 'a' AS a, 'b' AS b, 2 AS sm, 200 AS qm UNION ALL select 'a' AS a, 'b' AS b, 2 AS sm, 200 AS qm )r group by a,b ab4400 [UNION] select a,b,sum(sm) AS s1, SUM(qm) AS s2 from ( select 'a'…