我正在尝试更新表test_ctrl.control_s
中的test1.control_s值。
我正在使用此代码:
proc sql;
update test1
set control_s= (select control_s
from test_ctrl
inner join test1
on test1.custno=test_ctrl.custno
and test1.accno=test_ctrl.accno);
quit;
我正在处理百万条记录。我必须使用join,但我无法使用。
答案 0 :(得分:0)
您不需要加入,只需使用相关子查询。
proc sql;
update test1
set control_s= (select control_s
from test_ctrl
where test1.custno=test_ctrl.custno
and test1.accno=test_ctrl.accno);
quit;
以下是使用sashelp.class
的示例:
data class;
set sashelp.class;
height=0;
run;
data ht_data;
set sashelp.class;
keep name height;
run;
proc sql;
update class
set height = (
select height from ht_data
where ht_Data.name = class.name
);
quit;