SQL 2023 · Changing data

Insert from a query

Copy rows from a query into another table.

INSERT INTO archive (id, name) SELECT id, name FROM users WHERE active = false;

Official SQL 2023 documentation

More changing data commands

All changing data commands · SQL 2023 cheatsheet

Was this page helpful?