~/devreads

#merge

3 posts

13 Mar 2025

lukaseder 1 min read

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…

sqldatabricksfirebirdmergeouter join

29 May 2024

vladmihalcea 1 min read

Introduction In this article, we are going to see how the Hibernate ON CONFLICT DO clause works, and how we can use it to execute an SQL UPSERT statement in a portable way. Upsert As I explained in this article, if you have this use case where you need to either INSERT or UPDATE a table record based on whether…

hibernatejpamergemysqlon conflict

10 Apr 2020

lukaseder 1 min read

The SQL MERGE statement is a device whose mystery is only exceeded by its power. A simple example shows its full power according to standard SQL. Imagine you have a production table for product prices, and a staging table from which you want to load the latest prices. For once, I’m using the Db2 LuW … Continue reading The Many…

sqlmergemerge statement