Jump to content

Archived

This topic is now archived and is closed to further replies.

AV1611

Using Joins...

Recommended Posts

If I had two tables:

Table A has some records that B doesn't

Table B has some records that A doesn't

I can do JOIN on FIELD1

I want ALL records...

Can't do left, can't do right... for obvious reasons...

Share this post


Link to post
Share on other sites
you can do a simple query and join the records in the WHERE clause:
[code]
SELECT * FROM table1 a, table2 b WHERE a.field1 = b.field1;
[/code]

Share this post


Link to post
Share on other sites
That won't do it because if A exists and B doesn't you won't get A and vice versa...
[!--quoteo(post=354504:date=Mar 13 2006, 09:36 AM:name=obsidian)--][div class=\'quotetop\']QUOTE(obsidian @ Mar 13 2006, 09:36 AM) [snapback]354504[/snapback][/div][div class=\'quotemain\'][!--quotec--]
you can do a simple query and join the records in the WHERE clause:
[code]
SELECT * FROM table1 a, table2 b WHERE a.field1 = b.field1;
[/code]
[/quote]

Share this post


Link to post
Share on other sites
[!--quoteo(post=354586:date=Mar 13 2006, 12:53 PM:name=AV1611)--][div class=\'quotetop\']QUOTE(AV1611 @ Mar 13 2006, 12:53 PM) [snapback]354586[/snapback][/div][div class=\'quotemain\'][!--quotec--]
That won't do it because if A exists and B doesn't you won't get A and vice versa...
[/quote]

ah, i see what you're saying. did you try OUTER JOIN?

Share this post


Link to post
Share on other sites
Let me try outer joins... I've never used it... but this is a common problem for me..

THANKS!

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.