here

回答: 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

請您先登陸,再發跟帖!