---
title: "A SQL MERGE statement performs actions based on a RIGHT JOIN"
url: https://daily.dev/posts/a-sql-merge-statement-performs-actions-based-on-a-right-join-hxd3ycmzt
source_url: https://blog.jooq.org/think-about-sql-merge-in-terms-of-a-right-join/
type: article
source: "JOOQ"
published: 2025-03-13T15:07:09.372Z
updated: 2025-03-13T15:07:37.993Z
tags: ["sql", "microsoft-sql-server", "databricks"]
reading_time: 8
upvotes: 4
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# A SQL MERGE statement performs actions based on a RIGHT JOIN

**[JOOQ](https://daily.dev/sources/jooq)** · 8 min read · 4 upvotes · 0 comments

## Summary

The post explains how the SQL MERGE statement operates based on a RIGHT JOIN between target and source tables. It describes the use of MERGE for performing INSERT, UPDATE, and DELETE operations depending on whether rows in the target table match those in the source table. The MERGE statement is particularly useful in ETL (Extract, Transform, Load) jobs for updating or inserting rows based on matching conditions. Additionally, it covers the extension of the MERGE statement with clauses like NOT MATCHED BY SOURCE and NOT MATCHED BY TARGET, which enhances its functionality.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.jooq.org/think-about-sql-merge-in-terms-of-a-right-join/>

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#sql](https://daily.dev/tags/sql), [#microsoft-sql-server](https://daily.dev/tags/microsoft-sql-server), [#databricks](https://daily.dev/tags/databricks)

[View this post on daily.dev](https://daily.dev/posts/a-sql-merge-statement-performs-actions-based-on-a-right-join-hxd3ycmzt)
