1. 组内排序
SQL:
proc sql; create table data2 as select *, row_number() over (partition by id, class, date order by time) as rank from data; run;
SAS:
data data2; set data; by id class date time; if first.date then rank=1;else rank+1; run;
标签:rank,id,date,SQL,SAS,data,对应 From: https://www.cnblogs.com/zooz-logging/p/16884355.html