Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLupserts ON CONFLICT MERGESingle-choice MCQ

In an upsert, what does the EXCLUDED pseudo-table refer to inside the DO UPDATE clause?

INSERT INTO inventory (sku, qty) VALUES ('A1', 5) ON CONFLICT (sku) DO UPDATE SET qty = inventory.qty + EXCLUDED.qty;