SQL 2023 · Changing data

Insert or update (PostgreSQL and SQLite)

Insert a row, or update it if the key already exists.

INSERT INTO users (email, name) VALUES ('[email protected]', 'Ada')
ON CONFLICT (email) DO UPDATE SET name = EXCLUDED.name;

Official SQL 2023 documentation

More changing data commands

All changing data commands · SQL 2023 cheatsheet

Was this page helpful?