A表中的值为代码(例如课程号)
其他表里保存的是代码对应的记录值。如果把A表中多个字段的代码,替换为其代码所对应的记录值?

解决方案 »

  1.   

    update a
    set 字段1=b.字段,字段2=c.字段.....
    from b,c,.....
    where a.id=b.id and a.id=c.id and...
      

  2.   

    update tba
    set 代码=记录值
    from tbb
    where tba.代码=tbb.代码
      

  3.   


    update a
    set a.id=b.字段,a.id=c.字段.....
    from b,c,.....
    where a.id=b.id and a.id=c.id and...
      

  4.   

    update a
    set a.id=b.字段,字段2=c.字段.....
    from b,c,.....
    where a.id=b.id and a.id=c.id and...
      

  5.   

    select b.记录值
    from a join b 
    on a.代码=b.代码