我现在想要把A表的数据(name_id,name)插入到已有的表B表中(id,name_id,name)其中A表和B表的字段(name_id,name)的类型是一样的。
用select 列名 into 新表名 from 旧表名 这个只能插入到数据库中不存在新表的情况下。
我现在是B表在数据库中是已有的~!
请大家帮个忙

解决方案 »

  1.   

    INSERT INTO b  (name_id,name)
    SELECT name_id,name
    FROM a
    --WHERE (name_id= '0766')
      

  2.   

    insert into B(name_id,name)
    select name_id,name from A
      

  3.   

    I guess you should set the field named "id" with property of auto-increment
      

  4.   

    insert into A(id,name_id,name)
    select seq.nextval, name_id,name
      from B
     where ...
      

  5.   

    insert into b( name_id,name )
          select name_id, name from a前提:b表的id为自增长