insert into 表1(type,name,layer,dranum,)(select type,name,layer,dranum from 表2) 表2少 一个字段,这个字段值是人为确定的
insert into 表1(type,name,layer,dranum,)(select type,name,layer,dranum, '人为确定的值' from 表2) 表2少 一个字段,这个字段值是人为确定的
insert into 数据表(字段1,字段2,字段3,字段4.....)select (字段1,字段2,字段3...)from 表1 where 条件 union select (字段1,字段2,字段3...)from 表2 where 条件
insert into tab col1,col2 select emp.name,dept.deptno emp inner join dept on emp.deptno = dept.deptno
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执行成功,也可以选出表中的内容,但是实际上却没有插入数据库中,这是为什么?谢谢各位了!
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执行成功,也可以选出表中的内容,但是实际上却没有插入数据库中,这是为什么?
表2少 一个字段,这个字段值是人为确定的
表2少 一个字段,这个字段值是人为确定的
insert into 数据表(字段1,字段2,字段3,字段4.....)select (字段1,字段2,字段3...)from 表1 where 条件
union select (字段1,字段2,字段3...)from 表2 where 条件
select emp.name,dept.deptno
emp inner join dept on emp.deptno = dept.deptno