请问一下,oracle中多行记录录入,insert into 数据表(字段1,字段2,字段3,字段4.....)(select (字段1,字段2,字段3...)from 表1  where 条件) 如果除了表1的字段外,我还想插入表1外的其他字段,怎么插入? 非常谢谢!

解决方案 »

  1.   

    表1和其它的表JOIN不就可以了?
      

  2.   

    insert into 表1(type,name,layer,dranum,)(select  type,name,layer,dranum  from 表2)
    表2少 一个字段,这个字段值是人为确定的
      

  3.   

    insert into 表1(type,name,layer,dranum,)(select  type,name,layer,dranum, '人为确定的值'  from 表2) 
    表2少 一个字段,这个字段值是人为确定的
      

  4.   


    insert into 数据表(字段1,字段2,字段3,字段4.....)select (字段1,字段2,字段3...)from 表1  where 条件 
    union select (字段1,字段2,字段3...)from 表2  where 条件 
     
      

  5.   

    insert into tab col1,col2
    select emp.name,dept.deptno
    emp inner join dept on emp.deptno = dept.deptno
      

  6.   

    insert into A.wordiv_modify (MODIFYID,BATCH,STAENDFRAME,LAYER,DRANUM,PARTNAME,ASSEMBLYNUM,SINGLENUM,SUITNUM,DIVISIONPATH,MODIFYTYPE,MEMO)(select 5,BATCH,STAENDFRAME,LAYER,DRANUM,PARTNAME,ASSEMBLYNUM,SINGLENUM,SUITNUM,DIVISIONPATH,'0',MEMO from A.wordiv_temp where dranum in ((select distinct dranum from A.wordiv_temp) minus (select  distinct dranum from A.wordiv_main)));select * from A.wordiv_modify;SQL语句已经解决,用sqlplus执行成功,也可以选出表中的内容,但是实际上却没有插入数据库中,这是为什么?谢谢各位了!
      

  7.   

    insert into A.wordiv_modify (MODIFYID,BATCH,STAENDFRAME,LAYER,DRANUM,PARTNAME,ASSEMBLYNUM,SINGLENUM,SUITNUM,DIVISIONPATH,MODIFYTYPE,MEMO)(select 5,BATCH,STAENDFRAME,LAYER,DRANUM,PARTNAME,ASSEMBLYNUM,SINGLENUM,SUITNUM,DIVISIONPATH,'0',MEMO from A.wordiv_temp where dranum in ((select distinct dranum from A.wordiv_temp) minus (select  distinct dranum from A.wordiv_main))); select * from A.wordiv_modify; SQL语句已经解决,用sqlplus执行成功,也可以选出表中的内容,但是实际上却没有插入数据库中,这是为什么?
      

  8.   

    insert 不是自动提交吗,为什么还要commit?