有两个数据集,如下:
data test;
input cust_id x y;
cards;
1 1 2
2 3 4
3 3 3
4 1 3
;
run;
data test1;
input cust_id x y;
cards;
1 1 2
2 1 3
2 3 5
5 3 4
6 3 3
;
run;
要实现,在数据集test1中选出变量 cust_id 和 x 都不在test中的观测,需要得到的结果集如下。
2 1 3
5 3 4
6 3 3
我尝试了以下代码:
proc sql;
create table work.new as
select * from test1
where test1.cust_id not in (select cust_id from test)
;
quit;
这样只是在对cust_id进行判断。
请问,如何能把变量x的判断也加入where条件呢?
where test1.cust_id not in (select cust_id from test) and test1.x not in (select x from test)
这个条件不对啊????????