[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql
Subject:    RE: Combining Multiple Tables
From:       "Weston, Craig (OFT)" <Craig.Weston () oft ! state ! ny ! us>
Date:       2008-09-26 14:44:24
Message-ID: E9C66DE22474F54D9152AD9B4191E9BC0366AC78 () EXCNYSM0A1AM ! nysemail ! nyenet
[Download RAW message or body]

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:tcarty@nucleadl.com] 
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/mysql?unsub=mysql-marcsub@progressive-comp.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic