# WHEN NOT MATCHED BY SOURCE

Published articles for WHEN NOT MATCHED BY SOURCE.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Think About SQL MERGE in Terms of a RIGHT JOIN

DevFeed: [Think About SQL MERGE in Terms of a RIGHT JOIN](<https://devfeed.tech/articles/think-about-sql-merge-in-terms-of-a-right-join-28967.md>)

Original publisher: [Read original article](<https://blog.jooq.org/think-about-sql-merge-in-terms-of-a-right-join/>)

Author: lukaseder

Published: 2025-03-13T14:45:53Z

Content type: tutorial

Language: en

Sources: [jOOQ](<https://devfeed.tech/sources/jooq.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [etl](<https://devfeed.tech/topics/etl.md>), [rdbms](<https://devfeed.tech/topics/rdbms.md>)

Tags: [databricks](<https://devfeed.tech/tags/databricks.md>), [etl](<https://devfeed.tech/tags/etl.md>), [firebird](<https://devfeed.tech/tags/firebird.md>), [merge](<https://devfeed.tech/tags/merge.md>), [outer-join](<https://devfeed.tech/tags/outer-join.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [right-join](<https://devfeed.tech/tags/right-join.md>), [schema](<https://devfeed.tech/tags/schema.md>), [semantics](<https://devfeed.tech/tags/semantics.md>), [source](<https://devfeed.tech/tags/source.md>), [sql](<https://devfeed.tech/tags/sql.md>), [sql-server](<https://devfeed.tech/tags/sql-server.md>), [statement](<https://devfeed.tech/tags/statement.md>), [syntax](<https://devfeed.tech/tags/syntax.md>), [table](<https://devfeed.tech/tags/table.md>), [target-table](<https://devfeed.tech/tags/target-table.md>), [when-matched](<https://devfeed.tech/tags/when-matched.md>), [when-not-matched](<https://devfeed.tech/tags/when-not-matched.md>), [when-not-matched-by-source](<https://devfeed.tech/tags/when-not-matched-by-source.md>)

### AI overview

The article explains SQL MERGE by relating its target-and-source behavior to a RIGHT JOIN. It covers updating matching rows, inserting nonmatching rows, deletion behavior, and the restriction against duplicate matches.

### Source excerpt

RIGHT JOIN is an esoteric feature in the SQL language, and hardly ever seen in the real world, because almost every RIGHT JOIN can just be expressed as an equivalent LEFT JOIN. The following two statements are equivalent: It's not unreasonable to expect these two statements to produce the same execution plan on most RDBMS, ... Continue reading Think About SQL MERGE in Terms of a RIGHT JOIN ->