当程序运行时,怎样能把 表1 的某列内容复制到 表2 某一空白列呢?
例如:要把table1的num复制到table2的num中!这问题能实现吗?谢谢各位热心帮助```不会的顶一下````````

解决方案 »

  1.   

    update table2 set num=(select num from table1 where table1与table2的关系如table1.col1=table2.col1)
    我曾经写了一个类似的SQL,在数据量比较大时此SQL语句比较花费时间,后来是通过临时表改变的性能
      

  2.   

    select table1.num from table1 into table2.num
      

  3.   

    update table2 set num=(select num from table1 where table1.ID=table2.Id)
      

  4.   

    update table2 set num=(select num from table1 where 条件)
      

  5.   

    update b set b.num=a.num
    from table1 as a,table2 as b
    where a.id=b.id