select a.loc_cd, b.a_number, a.loc_name from loc a left join loc2 b on a.loc_cd = b. loc_cd UNION select c.loc_cd, c.a_number, d.loc_name from loc2 c left join loc d on c.loc_cd = d.loc_cd
Gaulin, Mark wrote: >Hmm.... that is nasty > >One solution would be to do a union of three selects, one selecting just >the case of being in both tables, the next for those records in table 1 >only, the last for those records in table 2 only. Kinda lame, but >better than nothing. > > Mark > >-----Original Message----- >From: Ian Skinner [mailto:[EMAIL PROTECTED] >Sent: Thursday, September 01, 2005 2:24 PM >To: CF-Talk >Subject: LEFT AND RIGHT OUTER JOIN? > >I think I have solidly walked into the realm of "why are you trying to >do this?" So any suggestions on alternate ways to look at this problem >are welcome. > >Say I have two tables something like these: > >TABLE ONE >Loc_CD Loc_Name >ABC This >DEF That >DFE The Other > >TABLE TWO >Loc_CD A_Number >DEF 123 >ALT 456 > >I need a combined table that would look like this. >Loc_CD Loc_Name A_Number >ABC This >DEF That 123 >DFE The Other >ALT 456 > >Please presume I did not create the base table and have little control >over their structure and data. But I need to somehow derive the >combined table. > >How would one do this, is there such a thing as a double/left&right >join? > > >-------------- >Ian Skinner >Web Programmer >BloodSource >www.BloodSource.org >Sacramento, CA > >"C code. C code run. Run code run. Please!" >- Cynthia Dunning > >Confidentiality Notice: This message including any attachments is for >the sole use of the intended >recipient(s) and may contain confidential and privileged information. >Any unauthorized review, use, disclosure or distribution is prohibited. >If you are not the intended recipient, please contact the sender and >delete any copies of this message. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:217145 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54