update jqhdzt set shid=(select shid from v_plat_userjqinfo t where jqhdzt.jqbh=t.JQBH
 and jqhdzt.shid<>t.SHID  )
 where shid='0000010047'  and exists
 (select 1 from v_plat_userjqinfo t where jqhdzt.jqbh=t.JQBH
 and jqhdzt.shid<>t.SHID )

后面的

exists
 (select 1 from v_plat_userjqinfo t where jqhdzt.jqbh=t.JQBH
 and jqhdzt.shid<>t.SHID )  一定要加上,否则可能造成数据更新混乱。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-08-24
  • 2021-11-08
  • 2022-12-23
  • 2022-01-13
  • 2021-08-30
猜你喜欢
  • 2021-06-03
  • 2021-08-13
  • 2021-08-27
  • 2022-12-23
  • 2022-01-21
  • 2021-07-28
相关资源
相似解决方案