
如果表A的id和表B的hitsid相同,则替换sql语句
update v9_hits SET hitsid = REPLACE(hitsid,’c-12-‘,’c-13-‘)
where 1 = ( case when(select COUNT(*) from v9_photo where id=replace(hitsid,’c-12-‘,”))>0 then ‘1’ else ‘0’ end)
update v9_hits SET hitsid = REPLACE(hitsid,’c-12-‘,’c-13-‘)
from v9_hits,v9_photo where id=replece(hitsid,’c-12-‘,”)
这表示用尾号连接,能连接上的就给你修改.
文章来源网络,作者:运维,如若转载,请注明出处:https://shuyeidc.com/wp/114912.html<