|
|
7#

楼主 |
发表于 2010-8-18 01:00:39
|
只看该作者
Re: 找最大值!
[code:2eqzbbbk]data a;
input g x1-x3;
cards;
20010102 3 1 3
20010102 5 1 5
20010102 8 1 8
20010103 1 2 1
20010103 5 2 5
20010104 3 3 3
20010104 5 3 5
20010104 1 3 1
20010105 5 4 5
20010105 12 4 12
20010105 8 4 8
;
run;
proc sql;
create table aa1(drop=x) as
select *,max(x) as max_x
from (select *,max(x1,x2,x3) as x from a)
group by g;
quit;[/code:2eqzbbbk]
I was confused by why you have to create a variable for group, actually you can treat '20010102,20010103, . . .' themselves as group variable.
And sorry if I misunderstood what you really want. |
|