"MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> wrote on 10/26/2017
02:50:57 PM:
It doesn't make sense to
MERGE INTO

The same table you are
USING (SELECT * FROM)


I understand what you're trying to accomplish, Art, but as Charles
pointed out the MERGE needs to find something. You're trying to save
yourself having to separately check if the row exists before deciding
whether to insert the row or update. When I've done this I joined the
table with another table that had related data in it to use when needing
to insert a new row in the first table. Thus, there would always be a row
for the MERGE to find but one side of the join would be NULL columns if
the row did not exist in the first table. Thus, the MERGE could either
MATCH or NOT MATCH as appropriate. Do you have a related table you can
join to your table?

Sincerely,

Dave Clark

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.