Merge (SQL)

A relational database management system uses SQL MERGE (also called upsert) statements to INSERT new records or UPDATE or DELETE existing records depending on whether condition matches.

You cannot update a Target row multiple times with a MERGE statement Database management systems PostgreSQL,[1] Oracle Database, IBM Db2, Teradata, EXASOL, Firebird, CUBRID, H2, HSQLDB, MS SQL, Vectorwise and Apache Derby support the standard syntax.

[4] Some other database management systems support this, or very similar behavior, through their own, non-standard SQL extensions.

MySQL, for example, supports the use of INSERT ... ON DUPLICATE KEY UPDATE syntax[5] which can be used to achieve a similar effect with the limitation that the join between target and source has to be made only on PRIMARY KEY or UNIQUE constraints, which is not required in the ANSI/ISO standard.

[8] Firebird supports MERGE INTO though fails to throw an error when there are multiple Source data rows.

Spark SQL supports UPDATE SET * and INSERT * clauses in actions.

Redis does not know any detail of the internal structure of the value, so an update would have no meaning.