here

來源: 暖小蛇 2010-07-13 19:24:05 [] [博客] [舊帖] [給我悄悄話] 本文已被閱讀: 次 (402 bytes)
回答: ok,我這樣解釋,你看對不對暖小蛇2010-07-13 17:48:32
proc sql;
create table idx_date_1 as
select name, min(date) as idx_dte_1, avg(ret) as avg_ret_1 from dataset
group by name;
quit;

proc sql;
create table idx_date_2 as
select a.name, avg(ret) as avg_ret_2
from dataset a inner join idx_date_1 b on a.name=b.name
where date gt idx_dte_1
group by a.name;
quit;

replace dataset with the name of the real dataset.

所有跟帖: 

another try -暖小蛇- 給 暖小蛇 發送悄悄話 暖小蛇 的博客首頁 (405 bytes) () 07/13/2010 postreply 19:34:17

謝謝!非常感謝! 你太可愛了 -Janezhu- 給 Janezhu 發送悄悄話 (0 bytes) () 07/13/2010 postreply 19:48:15

請您先登陸,再發跟帖!

發現Adblock插件

如要繼續瀏覽
請支持本站 請務必在本站關閉/移除任何Adblock

關閉Adblock後 請點擊

請參考如何關閉Adblock/Adblock plus

安裝Adblock plus用戶請點擊瀏覽器圖標
選擇“Disable on www.wenxuecity.com”

安裝Adblock用戶請點擊圖標
選擇“don't run on pages on this domain”