我正在将oracle包用于out项目中的报告之一。 当同时访问此程序包时,以下查询将导致死锁。 请提出任何建议以改善此查询:
UPDATE temp_final t
SET notnullcol = ( select COALESCE(h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13,h14,h15,h16,h17,h18,h19,h20,h21,h22,h23,h23 )
from temp_final
where ( ( rowgroup = 'G' and mid = t.seid)
or ( rgroup = 'K' and t.rgroup = rgroup and t.mid = mid )
or ( rgroup = 'G' and t.rgroup = rgroup and t.mid = mid )
)
and rid = t.rid
and rtype = t.rtype
and sid = t.sid
and pid = t.pid AND rid = 9 AND rtype =1 AND sid = 'value' AND pid = 421 )
--5,034 rows updated.
请注意,temp_final是一个临时表,所有h *列都用于计算,因此无法使用该表的架构。