两个表的结构完全一样,但是我要实现的的是table1里面有的id,就不从table2中select出来
insert into table1 (select * from table2);

解决方案 »

  1.   

    insert into table1 (select * from table2 where id not in (select id from table1));
      

  2.   

    insert into table1 
    (select * from table2 where not exists (select * from table1 where table2.id=table1.id));
      

  3.   

    insert into table1 (select * from table2 where id not in(select id from table1));
      

  4.   

    你是不是要用 minus 或 union 呢?抱歉 没看懂 你啥意思
      

  5.   

    select * from table1
    minus
    select * from table2