UPDATE
Complete UPDATE statement guide for MariaDB. Complete syntax reference with WHERE conditions, JOIN operations, CTEs, and multi-table updates for production use.
Syntax
UPDATE [LOW_PRIORITY] [IGNORE] table_reference
[PARTITION (partition_list)]
[FOR PORTION OF period FROM expr1 TO expr2]
SET col1={expr1|DEFAULT} [,col2={expr2|DEFAULT}] ...
[WHERE where_condition]
[ORDER BY ...]
[LIMIT row_count]
RETURNING OLD_VALUE(val) AS old [, val as new]UPDATE [LOW_PRIORITY] [IGNORE] table_references
SET col1={expr1|DEFAULT} [, col2={expr2|DEFAULT}] ...
[WHERE where_condition]CTE Syntax
Description
PARTITION
FOR PORTION OF
UPDATE Statements With the Same Source and Target
Examples
Single-Table
Single-Table With RETURNING Clause
Multi-Table
CTE Single-Table
CTE Multi-Table
See Also
Last updated
Was this helpful?

