标题: 为什么需要Reflexive Join [打印本页] 作者: shiyiming 时间: 2011-1-9 14:49 标题: 为什么需要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.
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;