作者liton (欧吉桑留学生)
看板Statistics
标题Re: [程式] sas资料选取问题
时间Thu Jun 24 22:24:36 2010
※ 引述《liton (欧吉桑留学生)》之铭言:
: ※ 引述《tew (咖啡王子)》之铭言:
: : proc sql;
: : create table a
: : as select a.comp_id, b.date
: : from test a, test b
: : where a.date>=b.date and
: : (a.comp_id=1101 or a.comp_id=1102)
: : order by comp_id,date;
: : quit;
原PO下条件的时候 程式条件也就跟着一对一的写出来了
不就两个条件而已?
'抓1101公司20090417前的日期'
与==>或
'抓1102公司20090612前的日期'
这问题各位怎会想的那麽复杂啊?
proc sql;
create table b
as select * from test
where (test.comp_id eq 1101 and test.date le '17Apr2009'd)
'抓1101公司20090417前的日期'
or (test.comp_id eq 1102 and test.date le '12Jun2009'd)
'与抓1102公司20090612前的日期'
order by comp_id,date;
quit;
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.167.170.248