| Date: | Mon, 3 Mar 2003 23:34:09 -0600 |
| Reply-To: | Kevin Myers <KevinMyers@AUSTIN.RR.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Kevin Myers <KevinMyers@AUSTIN.RR.COM> |
| Subject: | Natural Join |
| Content-Type: | text/plain; charset="iso-8859-1" |
Hi folks,
There's something about natural join behavior in SAS that I don't understand. I have the following three tables (some columns omitted for simplicity):
Table: state
Columns: stateCode
Table: regDistrict
Columns: stateCode, regDistCode
Table: county
Columns: stateCode, countyCode, countyName, regDistCode
Now I create two views:
create view regDistrictView as
select * from regDistrict natural join state;
create view countyView as
select * from county natural join regDistrictView;
The resulting views contain columns as follows:
View: regDistrictView
Columns: stateCode, regDistCode
View: countyView
Columns: stateCode, regDistCode, stateCode, countyCode, countyName
Now my question is, why is the stateCode column duplicated in countyView, when it is NOT duplicated in regDistrictView??? Thanks in advance for any tips.
s/KAM
|