update dkc_hsp_pi a
set a.UaID = (select uid from
(
select uid,
emplid,
max(EFFDT)
from sysadm.ps_ua_eds_data
group by uid,
emplid ) s)
where s.emplid = a.emplid;发布于 2013-05-25 02:28:31
无法从使用别名的位置访问别名"s“:尝试将WHERE子句上移一级,如下所示:
update dkc_hsp_pi a
set a.UaID =
(
select uid from
(
select uid,
emplid,
max(EFFDT)
from sysadm.ps_ua_eds_data
group by uid, emplid
) s
where s.emplid = a.emplid
)
;如果您的子查询返回多个结果,则需要将第一个"="更改为"IN",或者相应地调整子查询(通过过滤row_number返回单行)。
https://stackoverflow.com/questions/16741359
复制相似问题