Problems / Consolidate Wide Reports / Editorial
SELECT region, 'jan' AS month, jan_sales AS sales FROM report_team_a
GROUP BY region, month
SUM(sales)
The instinctive approach — FULL OUTER JOIN the two wide tables on region, then add the column pairs — forces coalesce(a.jan_sales, 0) + coalesce(b.jan_sales, 0) for every month and breaks the moment a third team shows up. Unpivot + UNION ALL + GROUP BY treats "how many sources?" as just more rows: consolidation problems are almost always easier in long form.
coalesce(a.jan_sales, 0) + coalesce(b.jan_sales, 0)
Solve Consolidate Wide Reports yourself →