This article discusses the concept of upsert in SQL and explains how it works in different database management systems (DBMS) like MySQL, SQLite, and PostgreSQL. It provides examples and code snippets for each DBMS to demonstrate the various ways to perform upsert operations.

10m read timeFrom antonz.org
Post cover image
Table of contents
INSERTMySQL: REPLACEMySQL: INSERT...ON DUPLICATE KEY UPDATESQLite: INSERT OR...SQLite: INSERT...ON CONFLICTPostgreSQL: INSERT...ON CONFLICTSQL Standard: MERGEOther database enginesSummary

Sort: