Using UNION for Data Analysis
March 24, 2010 Skip Marchesani
To do a quick review of my previous article, UNION is very useful when an SQL statement or query must operate on two or more tables and JOIN cannot be used to produce the desired result set table. For example, if you have multiple history tables–one for each specific time period (year, month, week, etc.), and their record formats are similar and compatible, a union is a good way to query and combine two or more of these tables to derive a single, final result set table using SQL. Several months ago, a friend sent me the spreadsheet shown |