exists是个条件判定,是不会返true or false.
update hzk a set a.mcnbxh = ( select b.newdata from temp_xdata b where b.userid = 1 and b.colname = 'mcxh' and a.mcnbxh = b.olddata )
这样就可以了。
update hzk a set a.mcnbxh = ( select b.newdata from temp_xdata b where b.userid = 1 and b.colname = 'mcxh' and a.mcnbxh = b.olddata )
这样就可以了。
update hzk a set a.mcnbxh = ( select b.newdata from temp_xdata b where b.userid = 1 and b.colname = 'mcxh' and a.mcnbxh = b.olddata )
where exists(select 1 from temp_xdata c where c.userid = 1 and c.colname = 'mcxh' and a.mcnbxh = c.olddata );