| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> SQL to insert only new records
Hello everyone,
Here is a SQL statement I wrote to insert records from one table into another. The catch is that it ignores records that are already there, so you never have a duplicate primary key failure.
Does this statement bypass the indexes, causing performance problems ?
INSERT INTO table2
SELECT a.field1, a.field2, a.field3 FROM
table1 a, table2 b
WHERE
b.field1(+) = a.field1 AND b.field2(+) = a.field2 AND b.field1 is null AND b.field2 is null;
Regards,
John
Received on Mon May 05 1997 - 00:00:00 CDT
![]() |
![]() |