LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 23 Nov 2004 18:18:20 +0000
Reply-To:     iw1junk@COMCAST.NET
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ian Whitlock <iw1junk@COMCAST.NET>
Subject:      Re: Could I left join three tables in PROC SQL?
Comments: cc: "Amy L. Sheng" <lhsheng_1@YAHOO.COM>

Amy, You got answers for the syntax, but it should be pointed out that LEFT JOIN is a binary operation, so no you cannot left join three data sets. As Roger and Mark have shown you can left join T1 with T2 and then left join that result with T3. OR you can left join T1 with T3 and then left join that result with T2. In general the two results will be different. You have to decide, on the basis of what you want, which is correct. Ian_Whitlock@comcast.net =============================== Date: Tue, 23 Nov 2004 11:13:42 -0500 Reply-To: "Amy L. Sheng" <lhsheng_1@YAHOO.COM> Sender: "SAS(r) Discussion" From: "Amy L. Sheng" <lhsheng_1@YAHOO.COM> Subject: Could I left join three tables in PROC SQL? I have three tables: table: variables ----------------- T1: var1 var2 T2: var1 var3 T3: var2 var4 Could I left join three tables on T1.var1=T2.var1 and on T1.var2=T3.var2 ? What syntax in PROC SQL will work? Thank you.


Back to: Top of message | Previous page | Main SAS-L page