数据库中复杂的update语句会引发死锁吗?更新几十万条数据
updatecom_basicinfoaseta.usedspace=(selectsum(filesize)fromspm_filebwhereb.resourceid...
update com_basicinfo a
set
a.usedspace =
(select sum(filesize) from spm_file b where b.resourceid = a.id and b.status in (1,2))
where
(select count(1) from spm_file c where c.resourceid = a.id and c.status in (1,2)) > 0 展开
set
a.usedspace =
(select sum(filesize) from spm_file b where b.resourceid = a.id and b.status in (1,2))
where
(select count(1) from spm_file c where c.resourceid = a.id and c.status in (1,2)) > 0 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询