--try
insert into table2(...) select .. from table1 inner join table2 on table1.id1=table2.id2

解决方案 »

  1.   

    现在table2已经存在,不是insert into 的问题,我想update请问如何实现?
      

  2.   

    update a
    set a.col1=b.col1
    from table2 a,table1 b
    where a.id2=b.id1
      

  3.   

    --try
    update table1 set 字段=b.字段 
    from table1 a inner join table2 b on a.id1=b.id2 and ....条件....
      

  4.   

    update tab1 
    set field1=t.field1,field1=t.field2,field3=t.field3,....fieldn=t.fieldn
    from tab2 t
    where tab1.id1=t.id1 and tab1.id2=t.id2