insert 2号表 select * from 1号表 where id not in (select id from 2号表)

解决方案 »

  1.   

    insert into 2号表 
    (select * from 1号表 where 1号表.id not exists (select id from 2号表))
      

  2.   

    insert 2号表 select a.* from 1号表 a left join 2号表  b
    on a.id=b.id
    where b.id is null
      

  3.   

    InSert 2号表 
    select a.* 
    from 1号表 a Left Join
         2号表 b on a.id=b.id
    Where b.Id is null
      

  4.   

    另外我想问一下,是用以上各位所说的方式快呢,还是采用DTS数据包快?
    因为这两个表将位于不同的SERVER上,谢谢。
      

  5.   

    导入导出数据,选择由一sql语句导入,根据提示键入“select * from 1号表 where id not in (select id from 2号表)”
      

  6.   

    select * from 1号表 where id not in (select id from 2号表)