-
Notifications
You must be signed in to change notification settings - Fork 403
UPDATE
Daniël van Eeden edited this page Mar 13, 2024
·
4 revisions
SQL standard specifies the following UPDATE syntax:
UPDATE { table_name | ONLY "(" table_name ")" } [[AS] alias]
SET set_clause_list
[WHERE condition | WHERE CURRENT OF cursor_name]
This base syntax is pretty well supported (except in Spark):
UPDATE table_name [[AS] alias]
SET set_clause_list
[FROM from_clause]
WHERE condition
DB2:
UPDATE { table_name | ONLY "(" table_name ")" | "(" fullselect ")" }
[[AS] correlation_clause]
[INCLUDE include_columns]
SET set_clause_list
[WHERE condition | WHERE CURRENT OF cursor_name]
[WITH {RR | RS | CS | UR}]
Hive:
UPDATE table_name
SET set_clause_list
[WHERE condition]
UPDATE [LOW_PRIORITY] [IGNORE] table_name
[PARTITION "(" partition_list ")"]
[FOR PORTION OF period FROM expr1 TO expr2]
SET set_clause_list
[WHERE condition]
[ORDER BY ...]
[LIMIT row_count]
UPDATE [LOW_PRIORITY] [IGNORE] table_name
SET set_clause_list
[WHERE condition]
[ORDER BY ...]
[LIMIT row_count]
N1QL:
UPDATE table_name
[USE [PRIMARY] KEYS expr]
[SET set_clause_list]
[UNSET unset_clause_list]
[WHERE condition]
[LIMIT expr]
[RETURNING returning_clause]
UPDATE [hint] { table_name | ONLY "(" table_name ")" } [alias]
SET set_clause_list
[WHERE condition]
[[RETURN | RETURNING] returning_clause]
[LOG ERRORS error_logging_clause]
[WITH [RECURSIVE] with_clause]
UPDATE [ONLY] table_name [ * ] [[AS] alias]
SET set_clause_list
[FROM from_clause]
[WHERE condition | WHERE CURRENT OF cursor_name]
[RETURNING returning_clause]
[WITH [RECURSIVE] with_clause]
UPDATE table_name [[AS] alias]
SET set_clause_list
[FROM from_clause]
[WHERE condition]
UPDATE table_name
[[LEFT|RIGHT] JOIN [table_valued_expression] [ON condition]]
SET set_clause_list
[WHERE condition]
[LIMIT count]
UPDATE table_name
SET set_clause_list
[FROM from_clause]
[WHERE condition]
No support for UPDATE
[WITH [RECURSIVE] with_clause]
UPDATE [OR action] table_name
SET set_clause_list
[FROM from_clause]
[WHERE condition]
[RETURNING returning_clause]
action:
ABORT | FAIL | IGNORE | REPLACE | ROLLBACK
TiDB:
UPDATE [LOW_PRIORITY] [IGNORE] table_name
SET set_clause_list
[WHERE condition]
[ORDER BY ...]
[LIMIT row_count]
[WITH with_clause]
UPDATE [TOP ( expression ) [PERCENT]] table_name
SET set_clause_list
[FROM from_clause]
[WHERE condition | WHERE CURRENT OF [GLOBAL] cursor_name]
[OPTION query_hints]
UPDATE table_name
SET [(column = expression [, ... ])]
[WHERE condition]