Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bitbrain's sql challenge -- full outer join in MSAccess

Status
Not open for further replies.

thibault

Programmer
Sep 8, 1999
44
0
0
US
i cheated. i asked a few friends. i haven't checked this yet, because MS Compress blew up my operating system & replaced my autoexec.bat file with a pandora's box. i'm sure it'll work. this guy is the one of the smartest people i know:)<br>
<br>
I'm not sure that I understand, but here is an idea...<br>
select a.key from table_a as a left outer join table_b as b on a.key = b.key<br>
union<br>
select b.key from table_a as a right outer join table_b as b on a.key = b.key <p>bobbie "in chicago"<br><a href=mailto:thibault@hotbot.com>thibault@hotbot.com</a><br><a href= </a><br>blonde (36-27-36) put that in just to see if anyone's paying attention:)
 
Excellent! That's basically it but there is one little flaw. Test it out and see what you get.
 
sure...as soon as i get my computer back. the question of the day here was 'what is a 'full outer join'. i think i explained it farely well.<br>
where R U? do you have a name?:) <p>bobbie "in chicago"<br><a href=mailto:thibault@hotbot.com>thibault@hotbot.com</a><br><a href= </a><br>blonde (36-27-36) put that in just to see if anyone's paying attention:)
 
A full outer join returns all rows from both tables. Columns that do not exist in either of the two tables have null values. For example, if you have two tables;<br>
<br>
....TableA..............TableB<br>
KeyA.....DataA....KeyB....DataB<br>
1.........1a.............1.......1b<br>
2.........2a.............3.......3b<br>
3.........3a.............4.......4b<br>
5.........5a................<br>
<br>
A full outer join (all columns) that would return:<br>
<br>
KeyA..DataA..KeyB..DataB<br>
1.......1a.......1......1b<br>
2.......2a.......null...null<br>
3.......3a.......3......3b<br>
null....null.....4......4b<br>
5.......5a.......null...null<br>
<br>
Yes, I have a name but I am reluctant to splash it around the internet. I work in, well, it rhymes with etiquette.<br>
<br>
Have a good day<br>
<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top