Re: [程式] sas資料選取問題

看板Statistics作者 (歐吉桑留學生)時間14年前 (2010/06/24 22:24), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串8/9 (看更多)
※ 引述《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
文章代碼(AID): #1C8sgckE (Statistics)
討論串 (同標題文章)
文章代碼(AID): #1C8sgckE (Statistics)