AV1611 Posted March 13, 2006 Share Posted March 13, 2006 If I had two tables:Table A has some records that B doesn'tTable B has some records that A doesn'tI can do JOIN on FIELD1I want ALL records...Can't do left, can't do right... for obvious reasons... Link to comment https://forums.phpfreaks.com/topic/4831-using-joins/ Share on other sites More sharing options...
obsidian Posted March 13, 2006 Share Posted March 13, 2006 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] Link to comment https://forums.phpfreaks.com/topic/4831-using-joins/#findComment-16988 Share on other sites More sharing options...
AV1611 Posted March 13, 2006 Author Share Posted March 13, 2006 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] Link to comment https://forums.phpfreaks.com/topic/4831-using-joins/#findComment-17069 Share on other sites More sharing options...
obsidian Posted March 13, 2006 Share Posted March 13, 2006 [!--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? Link to comment https://forums.phpfreaks.com/topic/4831-using-joins/#findComment-17076 Share on other sites More sharing options...
AV1611 Posted March 13, 2006 Author Share Posted March 13, 2006 Let me try outer joins... I've never used it... but this is a common problem for me.. THANKS! Link to comment https://forums.phpfreaks.com/topic/4831-using-joins/#findComment-17082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.