Use null (or custom text) to replace the missing columns

A quick ex:

Select a,b,c,null,d from table1
Union all
Select d,'test valid',e,f,g from table 2




--------------------------------------------------------
This e-mail, including any attachments, may be confidential, privileged or 
otherwise legally protected. It is intended only for the addressee. If you 
received this e-mail in error or from someone who was not authorized to send it 
to you, do not disseminate, copy or otherwise use this e-mail or its 
attachments.  Please notify the sender immediately by reply e-mail and delete 
the e-mail from your system.


-----Original Message-----

From: Tim Carty [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 26, 2008 10:41 AM
To: mysql@lists.mysql.com
Subject: Combining Multiple Tables

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.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to