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?
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.
|