A.field1替换B.field1  条件是A.field2=B.field2我要把一个数据库表个里的数据写到另一个里面,一个一个的写太麻烦了

解决方案 »

  1.   

    update a  set a.field1 = b.field1 from A a ,B b where a.field2= b.field2
      

  2.   

    update b set b.field1 = a.field1 from a ,b where a.field2= b.field2
    >_<
      

  3.   

    update b  set b.field1 = a.field1 from A a ,B b where a.field2= b.field2
    在sql server 通过
      

  4.   

    update b  set b.field1 = a.field1 from A a ,B b where a.field2= b.field2
    是否要個AS
    update b set b.field1=a.field1 from A as a , B as b where a.field2=b.field2
      

  5.   

    太久沒用SQL,連這題也不會做...
      

  6.   

    insert table2 (Field1,Field2,……,Fieldn) select * from table1————————————————————————————————————
    宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
    ————————————————————————————————————