Date: Mon, 26 Jan 1998 13:50:39 -0600
Reply-To: Jack Hamilton <jack_hamilton@HCCOMPARE.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Jack Hamilton <jack_hamilton@HCCOMPARE.COM>
Subject: Re[2]: SQL UPDATE question
Content-Type: text/plain; charset=US-ASCII
"kmself@ix.netcom.com" <kmself@ix.netcom.com> wrote:
>In SQL, when referencing data from two tables (or datasets) requiring
>LIBNAME.MEMBER specification, you need to use a two-step method by
>creating an alias for the table(s) involved:
>
>/* assume datasets MYLIB.FOO and YOURLIB.BAR each containing VAR */
>
>Proc SQL;
> select f.var, b.var
> from mylib.foo as f, yourlib.bar as b /* define aliases */
> ;
This may not be start of the SQL standard, but in SAS, you can use
the dataset name as the alias, provided it's unique.
So this works:
9 proc sql;
10 select one.x, two.y
11 from a.one, b.two;
but this doesn't:
14 proc sql;
15 select one.x, one.y
16 from a.one, b.one;
|