|
|
楼主

楼主 |
发表于 2011-1-9 14:49:37
|
只看该作者
为什么需要Reflexive Join
例题(来自adv prep guide):
Suppose you want to list the names of supervisors for the crew on the flight to Copenhagen on March 4, 2000.
sasuser.flightschedule (empid, date, destination)
sasuser.staffmaster (empid, firstname, lastname, state)
sasuser.payrollmaster (empid, jobcode)
sasuser.supervisors(empid, state, jobcategory)
proc sql;
select distinct e.firstname, e.lastname
from sasuser.flightschedule as a,
sasuser.staffmaster as b,
sasuser.payrollmaster as c,
sasuser.supervisors as d,
sasuser.staffmaster as e
where a.date='04mar2000'd and
a.destination='cph' and
a.empid=b.empid and
a.empid=c.empid and
d.jobcategory=substr(c.jobcode,1,2)
and d.state=b.state
and d.empid=e.empid;
quit;
我的问题是:为什么list sasuser.staffmaster 两次,有必要吗? |
|