Coordinate concurrent access using row or table locks; syntax and isolation differ.
SELECT id, balance FROM accounts WHERE id = 1 FOR UPDATE;Coordinate concurrent access using row or table locks; syntax and isolation differ.
SELECT ... FOR UPDATE; -- support and clauses varyCoordinate concurrent access using row or table locks; syntax and isolation differ.
SELECT id, balance FROM accounts WHERE id = 1 FOR UPDATE;SQLite-oriented example; consult the relevant dialect manual.
SELECT id, balance FROM accounts WHERE id = 1 FOR UPDATE;| Option / clause | Description |
|---|---|
BEGIN / START TRANSACTION | Start a transaction; exact keywords vary by engine. |
COMMIT | Make the transaction's changes permanent. |
ROLLBACK | Undo uncommitted work or return to a savepoint. |
SAVEPOINT | Mark an intermediate point within a transaction. |
Isolation level | Choose concurrency behaviour 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.