dataset 自己和自己 Cartesian join。比如说
DATA one;
INPUT idx id;
DATALINES;
1 1
2 2
3 2
;
RUN;
proc sql;
create table test as
select a.idx as a_idx, a.id as a_id, b.idx as b_idx, b.id as b_id,
case when a.id = b.id then 'Y' else 'N' end as equal
from one a, one b where a.idx ne b.idx;
quit;
从结果能够看到row2和row3的id是一样的。