SAS中文论坛

 找回密码
 立即注册

扫一扫,访问微社区

查看: 906|回复: 0
打印 上一主题 下一主题

为什么需要Reflexive Join

[复制链接]

49

主题

76

帖子

1462

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1462
楼主
 楼主| 发表于 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 两次,有必要吗?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SAS中文论坛  

GMT+8, 2026-2-3 11:13 , Processed in 0.101370 second(s), 20 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表