我正在尝试从SAS数据集更新数据库记录。这就是我的尝试:
proc sql noprint;
UPDATE A
SET
A.IP = U.IP,
A.COUNTRY = U.COUNTRY,
A.CREATION_DATE = U.CREATION_DATE,
A.STATUS = U.STATUS
FROM db_table.COUNTRY A INNER JOIN SAS_dataset U
on A.APPLICATION=U.APPLICATION;
quit;
run;
收到错误:
106 A.IP = U.IP,
_
73
76
ERROR 73-322: Expecting an =.
ERROR 76-322: Syntax error, statement will be ignored.
使用Inserts 等我的其他代码可以正常工作。
答案 0 :(得分:1)
通过子查询解决
proc sql;
update tableA A
set var=
(select var
from tableB B
where B.id=A.id)
where exists (
select 1
from tableB B
where B.id=A.id);
quit;