update a set 专业编号=(select 新编号 from b where a.专业编号=b.原编号)

解决方案 »

  1.   

    update a set a.专业编号=b.新编号 from b where b.原编号=a.专业编号
      

  2.   

    update table1 set 专业编号 = (select 新编号 from table1,table2 where table2 .原编号 = table1.专业编号)
      

  3.   

    楼上的,这样写不行啊。select 新编号 from b where a.专业编号=b.原编号会返回很多值的
    开始我也是这么写的,根本不行。。
      

  4.   

    多谢singlepine(小山),呵呵,搞定了
      

  5.   

    update 表a set 专业编号=b.新编号
    from 表a a,表b b where a.专业编号=b.原编号 我发现我的写法有点问题更正一下!