Jusqu'à présent, j'ai cette requêtecontenu de la colonne Ajout dans une requête SQL UNION
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
Mon but est de UNION ces deux requêtes ajouter SOMME les colonnes « de ITEM_COUNT » foreach code_desc. Est-ce possible?
sacrément oublié le deuxième roll-up !! – brumScouse