insert into tbname 
select * from tb where not exists(select 1 from tbname where tbname.col=tb.col)

解决方案 »

  1.   

    select userid from user
    intersece
    select userid from TableName
      

  2.   

    是这样吗?
    insert into user(userid,password)
      select xh,xh from student where not exists (select userid from user
          where user.userid=student.xh) ;
    对吗?
      

  3.   

    to bzszp(SongZip) :
      你好! 如果我上面写的是对的,结果提示  ORA-00001: 索引中有重复的键那是错在哪里啊
      

  4.   

    insert into user(userid,password)
      select xh,xh from student where not exists(select 1 from user
          where user.userid=student.xh) group by xh;
      

  5.   

    to bzszp(SongZip) :
    主键是useridto beckhambobo(beckham):
        使用group by xh 的用途是什么啊?不用是不是应该一样啊?
      

  6.   

    insert into user(userid,password)
      select xh,xh from student where not in 
      (select xh,xh from user
          where user.userid=student.xh)