如果表A的id和表B的hitsid相同,则替换sql语句

如果表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-‘,”)

这表示用尾号连接,能连接上的就给你修改.

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容