【发布时间】:2019-08-22 08:44:27
【问题描述】:
我能够在 select 语句上获得结果,但在使用 update 时我遇到了问题。 数据库服务器:- Oracle 11g。
update t1
set t1.componentID = cteData.componentID
from tpinventryrecds t1
inner join ( select * from
(select TPLVLKEY , standardName , DOCTYPE , 'Default' as componentID ,count(*) as val from tpinventryrecds
where componentID is null
group by TPLVLKEY , standardName , DOCTYPE)`enter code here`
where val = 1) cteData
on t1.TPLVLKEY = cteData.TPLVLKEY
and t1.standardName = cteData.standardName
and t1.DOCTYPE = cteData.DOCTYPE;
【问题讨论】:
标签: sql oracle join sql-update