标题: 求助如何在sas中实现row_number功能 [打印本页] 作者: shiyiming 时间: 2011-5-26 13:18 标题: 求助如何在sas中实现row_number功能 数据库中的row_number语句不能再sas中应用。
例如:
proc sql;
select
id
,row_number() over(partition by id order by x desc)
from maps.world
;
quit;作者: shiyiming 时间: 2011-5-26 17:17 标题: Re: 求助如何在sas中实现row_number功能 功能是什么啊?作者: shiyiming 时间: 2011-5-26 21:07 标题: Re: 求助如何在sas中实现row_number功能 Ahuige mentioned a SAS SQL function of [b:2pnmzhpm]MONOTONIC( )[/b:2pnmzhpm], giving the row number of the table. I find this function is sort of bizarre. Honestly, i have never come with a good example on my own.
Jingju作者: shiyiming 时间: 2011-5-27 13:07 标题: Re: 求助如何在sas中实现row_number功能 例如:
proc sql;
create table test.tmp_test
(
user_id char(10)
,update_time char(15)
);
insert into test.tmp_test values('asia2011','20110529');
insert into test.tmp_test values('asia2011','20110528');
insert into test.tmp_test values('asia2011','20110527');
insert into test.tmp_test values('link2011','20110529');
insert into test.tmp_test values('link2011','20110528');
insert into test.tmp_test values('link2011','20110527');
run;
proc sql;
select
user_id
,update_time
,row_number() over(partition by user_id ,ordre by update_time)
from test.tmp_test
;
quit;