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-','')
这表示用尾号连接,能连接上的就给你修改.