insert into 目的表
 select * from 源表

解决方案 »

  1.   

    select * into 目的表 from 源表
      

  2.   

    insert into 目的表
     select * from 源表 where ....
      

  3.   

    insert into  表2
    select *
    from 表1
    where .........
      

  4.   

    例如:
    insert into 目的表
     select * from 源表 where id not in(select id from 目的表)
      

  5.   


      我的意思是 在我的目的表里有 一记录 
      不如
      表  table1 
        ID    Name 
        100   aaa  表 table1_tmp
        ID    Name 
        100   bbb   我想将 table1 的记录更新成  100  bbb 。
      

  6.   

    update table1 set name=table1_tmp.name from table1,tabe1_tmp where table1.id=table1_tmp.id
      

  7.   

    truncate table 目的表
    insert into 目的表
     select * from 源表
      

  8.   

    update a set a.name=b.name from 目的表 as a,源表 as b where a.id=b.id
    insert into 目的表
        select * from 源表 as b where id not in (select id from 目的表)