select ItemID, sum(totarticoli) as totale from ( SELECT ItemID, totarticoli FROM vista_vendite_negozio_online UNION ALL SELECT ItemID, totarticoli FROM vista_vendite_negozio_fisico ORDER BY ItemID ) x group by ItemID