日期:2014-05-17  浏览次数:20860 次

update不了,这语句要怎么写啊
两张关联表进行update

update   user_job   set   user_name=b.new_name   where   user_no   in   (select   user_no_old   from   user_class   b)

就是把两张表相同user_no的user_name给换了!!!可是怎么都不能   update


------解决方案--------------------
update t01_sales a set a.t01name = (select b.t01name from temp1 b where b.t00salesno = a.t00salesno)
------解决方案--------------------
楼上的语句对了一半。像你样写,会把整个表更新了。
update user_job set user_name=(select user_class.new_name from user_class where user_job.user_no=user_class.user_no_old) where user_job.user_no in(select user_no_old from user_class)