Skip to content

Glossary: SQL Beyond the Basics

Upsert

Also written: ON CONFLICT, DO UPDATE

An INSERT … ON CONFLICT … DO UPDATE that inserts a row, or updates the existing one if the key is already taken. Jo's stock table uses it to add new bags to an existing total.

Where the book teaches it

Related terms

RETURNINGexcluded