|
How about: insert into lib1.file1 select * from lib2.file1 a where (select "x" from lib1.file1 b where b.key1=a.key1 and b.key2=a.key2 and b.key3=a.key3 and b.key4=a.key4 and b.key5=a.key5 and b.key6=a.key6) = null Does that work any better? Dan Patrick Conner <PWConner@xxxxxxxxxxx> Sent by: midrange-l-bounces@xxxxxxxxxxxx 02/24/2005 02:05 PM Please respond to Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx> To midrange-l@xxxxxxxxxxxx cc Subject Better INSERT statement Is there a better way to insert records when wanting to add records to a file from an identical file while avoiding duplicate records? insert into lib1.file1 select * from lib2.file1 where (key1 || key2 || key3 || key4 || key5 || char(key6)) not in (select (key1|| key2 || key3 || key4 || key5 || char(key6)) from lib1.file1) -- Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain legally privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited. -- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.