I have this UPDATE query:
我有这个UPDATE查询:
UPDATE secugconductorinfo
INNER JOIN tblsecugconductor
ON secugconductorinfo.CONDUCTORGUID = tblsecugconductor.globalid
SET secugconductorinfo.conductorcount = '0'
WHERE Upper(tblsecugconductor.FILE_NAME) LIKE '%Q1222_S%'
AND secugconductorinfo.conductorsize = 'Unknown'
AND secugconductorinfo.insulation = 'Unknown'
AND secugconductorinfo.material = 'Unknown'
AND secugconductorinfo.conductorcount = '1'
I want to update conductorcount=0
for all rows of secugconductorinfo based on the join with tblsecugconductor.
But I'm getting:
我想基于与tblsecugconductor的连接更新secugconductorinfo的所有行的conductorcount = 0。但我得到了:
Error report: SQL Error: ORA-00971: missing SET keyword 00971. 00000 - "missing SET keyword"
错误报告:SQL错误:ORA-00971:缺少SET关键字00971. 00000 - “缺少SET关键字”
How should I change my query to perform this update?
我该如何更改查询以执行此更新?
2 个解决方案
#1
0
UPDATE secugconductorinfo
SET secugconductorinfo.conductorcount = '0'
WHERE secugconductorinfo.conductorsize = 'Unknown'
AND secugconductorinfo.insulation = 'Unknown'
AND secugconductorinfo.material = 'Unknown'
AND secugconductorinfo.conductorcount = '1'
AND exists (select 1
from tblsecugconductor
where secugconductorinfo.CONDUCTORGUID = tblsecugconductor.globalid
and Upper(tblsecugconductor.FILE_NAME) LIKE '%Q1222_S%')
You should use an exists statement to make the join. I corrected your code above.
您应该使用exists语句来进行连接。我纠正了你上面的代码。
#2
0
try this one :
试试这个:
UPDATE secugconductorinfo
SET conductorcount ='0'
from secugconductorinfo aa
INNER JOIN tblsecugconductor bb
ON aa.CONDUCTORGUID =
bb.globalid
WHERE Upper(bb.FILE_NAME)
LIKE '%Q1222_S%'
AND aa.conductorsize = 'Unknown'
AND aa.insulation = 'Unknown'
AND aa.material = 'Unknown'
AND aa.conductorcount = '1'
#1
0
UPDATE secugconductorinfo
SET secugconductorinfo.conductorcount = '0'
WHERE secugconductorinfo.conductorsize = 'Unknown'
AND secugconductorinfo.insulation = 'Unknown'
AND secugconductorinfo.material = 'Unknown'
AND secugconductorinfo.conductorcount = '1'
AND exists (select 1
from tblsecugconductor
where secugconductorinfo.CONDUCTORGUID = tblsecugconductor.globalid
and Upper(tblsecugconductor.FILE_NAME) LIKE '%Q1222_S%')
You should use an exists statement to make the join. I corrected your code above.
您应该使用exists语句来进行连接。我纠正了你上面的代码。
#2
0
try this one :
试试这个:
UPDATE secugconductorinfo
SET conductorcount ='0'
from secugconductorinfo aa
INNER JOIN tblsecugconductor bb
ON aa.CONDUCTORGUID =
bb.globalid
WHERE Upper(bb.FILE_NAME)
LIKE '%Q1222_S%'
AND aa.conductorsize = 'Unknown'
AND aa.insulation = 'Unknown'
AND aa.material = 'Unknown'
AND aa.conductorcount = '1'