So far I have this query
SELECT
COUNT(f.code_id) as item_count,
f.code_desc
FROM
foo f
INNER JOIN foohistory fh ON f.history_id = fh.history_id
WHERE
MONTH(fh.create_dt) = 6
AND YEAR(fh.create_dr) = 2010
GROUP BY
f.code_desc
UNION ALL
SELECT
COUNT(b.code_id) as item_count,
b.code_desc
FROM
bar b
INNER JOIN barhistory bh ON b.history_id = bh.history_id
WHERE
MONTH(bh.create_dt) = 6
AND YEAR(bh.create_dr) = 2010
GROUP BY
b.code_desc
My goal is to UNION these two queries add SUM the 'item_count' columns foreach code_desc. Is this possible?