I want to create a new table from 3 tables:
- table1 is source table
- table2 is subset of tabl1 except with one extra column
- table3 has different columns.
All these tables are linked by ID
column.
I know I will need a vertical join (UNION).
Query:
- I need to join all records in table2 and look up values from table2.field1 and get the record set from table1 where field1 in table2 is in table1.id
- I need to subset table3 where table3.date >= '2010-10-01' and use table3.id to get the record set from table1 where table3.id = table1.id
How do I use the UNION join to look up values, from table1 and keep all records from table2?