How to update table using merge from value rather than from a table

User16826994223
Databricks Employee
Databricks Employee

My question is how can we do an upsert directly, that is, without using a source table. I would like to give the values myself directly.

s there a simple way to do that for Delta tables?

User16826994223
Databricks Employee
Databricks Employee

A source table can be a subquery so the following should give you what you're after.

MERGE INTO events
 
USING (VALUES(...)) // round brackets are required to denote a subquery
 
ON false            // an artificial merge condition
 
WHEN NOT MATCHED THEN INSERT

*

View solution in original post