1、从一个表选出数据更新另一个表(后面的exists一定要加)
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)
时间: 2024-10-12 18:32:58