UPDATE statement modifies existing rows in a dataset. Each UPDATE assigns new values to one or more columns, optionally filtered by a WHERE clause.
UPDATE runs against datasets you own. To update rows during a materialized view refresh, use the MERGE ON clause inside
CREATE MATERIALIZED VIEW instead.Syntax
- The
SETclause lists column assignments. The right-hand side of each assignment can be any NQL expression valid for the target column’s data type, including references to other columns in the same row. - The
WHEREclause is optional. If omitted, every row in the dataset is updated — include aWHEREclause unless that is the intended behavior.
Examples
Update a single column with a literal:Execution context
UPDATE statements can run in two places:| Execution surface | When to use |
|---|---|
| NQL query endpoint | Ad-hoc updates from an API client or Data Studio |
ExecuteDml workflow task | Scheduled or event-driven updates inside a workflow |
Related content
INSERT
Add rows to a dataset
DELETE
Remove rows from a dataset
Incremental Upserts with MERGE ON
Update or insert rows during materialized view refresh
ExecuteDml workflow task
Run DML statements from a workflow

