Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucsd!helios.ee.lbl.gov!nosc!cod!dberg From: dberg@cod.NOSC.MIL (David I. Berg) Newsgroups: comp.databases Subject: Re: outer join question Summary: OUTER Keywords: outer, join, ingres, sql Message-ID: <1751@cod.NOSC.MIL> Date: 13 Jan 90 20:30:23 GMT References: <8314@newstop.EBay.Sun.COM> Distribution: usa Organization: Naval Ocean Systems Center, San Diego Lines: 24 In article <8314@newstop.EBay.Sun.COM>, mbordas@irma.Sun.COM (Mark Bordas - Sun Consulting) writes: > So the SQL statement, > "select socsec, name, amount_owed from table1 t1, table2 t2 > where t1.socsec = t2.socsec" returns: > (details omitted) > In other words, only the records that exist in both tables will be retrieved. > .....there are times when it would be desirable to have the > SQL statement return: > (details omitted) Use the SQL construct: select x,y,... from a OUTER b where....., like so: "select socsec, name, amount_owed from table1 t1, OUTER table2 t2 where t1.socsec = t2.socsec" This will give you the results you desire. -- David I. Berg (dberg@nosc.mil) GENISYS Information Systems MILNET: dberg@nosc.mil 4250 Pacific Hwy #118 UUCP: {akgua decvax dcdwest ucbvax}! San Diego, CA 92110 sdcsvax!noscvax!dberg (619) 226-1122