update B set B.maildata =(select SUBSTRING(maildata,0,3) from basedata where basedata.cid = B.cid)+(select CONVERT(varchar, CAST(SUBSTRING(maildata,3,4) as int )+100)
from basedata where basedata.cid = B.cid)+(select SUBSTRING(maildata,3+4,len(maildata)-1) from basedata where basedata.cid = B.cid) from basedata B where B.cid = 113

给要修改的表起别名的主要作用在于 子查询条件不唯一

05-12 10:46