List:General Discussion« Previous MessageNext Message »
From:Thomas Pundt Date:September 26 2008 2:44pm
Subject:Re: Combining Multiple Tables
View as plain text  
On Friday, 26. September 2008, Tim Carty wrote:
| I would like to combine multiple tables into a single table. I can create a
| UNION between tables with similar columns ­ cols A, B, and C  from table_1
| with cols A, B, and C from Table_2. What I can¹t figure out is how to add
| additionals columns (D, E, F) from table_2 if the columns don¹t exist in
| Table_1.

select a, b, c, null as d, null as e, null as f
  from table_1
 union
select a, b, c, d, e, f
  from table_2

should do it.

Ciao,
Thomas

-- 
Thomas Pundt <thomas.pundt@stripped> ---- http://rp-online.de/ ----
Thread
Combining Multiple TablesTim Carty26 Sep
  • RE: Combining Multiple TablesOFT)26 Sep
  • Re: Combining Multiple TablesThomas Pundt26 Sep