我的code如下:
[code:2e4t8gkf]
proc sql;
create table combine(drop=fname)
as select * from test2 as a
left join link2 as b
on a.fname=b.fname and b.namedt<=a.redate<=b.nameenddt;
quit;
[/code:2e4t8gkf]
test2中有55xxxx个observations,link2里面比较少,我想把link2加到test2中去,所以用left join,但是最后发现combine里面比test2少了2万个observations,这是怎么回事啊?用什么比较好?
Very interesting.
I thought the number of observations in the newly created dataset is no less than that in the left table in left join statement, whatever conditions put.