Example (standard-style syntax). Verify supported keywords in your database.
UPDATE users SET active = FALSE WHERE last_login < DATE '2024-01-01';Change values in existing rows.
UPDATE table_name SET column = value [, column = value] WHERE condition;Example (standard-style syntax). Verify supported keywords in your database.
UPDATE users SET active = FALSE WHERE last_login < DATE '2024-01-01';SQLite-oriented variant; dialect behaviour may differ.
UPDATE users SET active = 0 WHERE last_login < '2024-01-01';| Option / clause | Description |
|---|---|
SET | Assign values to one or more columns. |
WHERE | Limit rows being changed; omitting it may update every row. |
FROM / JOIN | Use other tables in the update where the dialect supports it. |
RETURNING / OUTPUT | Return updated rows where supported. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.