Hello! 

I have two tables: 

table a: and table b: 

+---+-----+ +---+-----+ 
| x | foo | | x | bar | 
+---+-----+ +---+-----+ 
| 1 | "a" | | 2 | "U" | 
| 2 | "b" | | 3 | "X" | 
| 4 | "c" | | 4 | "Y" | 
| 6 | "d" | | 5 | "Z" | 
+---------+ +---------+ 


x is the primary key(s) in both tables. 
foo and bar are the data column(s) in the tables. 

I need to select a result table like this: 

+---+-----+-----+ 
| x | foo | bar | 
+---+-----+-----+ 
| 1 | "a" | NUL | 
| 2 | "b" | "U" | 
| 3 | NUL | "X" | 
| 4 | "c" | "Y" | 
| 5 | NUL | "Z" | 
| 6 | "d" | NUL | 
+---------+-----+ 


That is, it gets the x key(s) from both tables, and 
the data (foo and bar) from one or both the tables who have records
with that key. 

Something like a LEFT JOIN and a RIGHT JOIN combined... 

Is this possible in one query??


mysql database 

Mike(mickalo)Blezien
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Thunder Rain Internet Publishing
Providing Internet Solutions that work!
http://www.thunder-rain.com
Tel: 1(225)686-2002
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to