Skip to main content
The 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

UPDATE table_reference
SET
  column1 = expression1
  [, column2 = expression2, ...]
[WHERE condition]
  • The SET clause 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 WHERE clause is optional. If omitted, every row in the dataset is updated — include a WHERE clause unless that is the intended behavior.

Examples

Update a single column with a literal:
UPDATE company_data."123"
SET status = 'archived'
WHERE user_id = 42
Update multiple columns using an expression:
UPDATE company_data."123"
SET
  email = LOWER(email),
  last_updated_at = CURRENT_TIMESTAMP
WHERE email IS NOT NULL
Conditional update across many rows:
UPDATE company_data.pipeline_log
SET status = 'stale'
WHERE
  status = 'created'
  AND created_at < CURRENT_TIMESTAMP - INTERVAL '30' DAY

Execution context

UPDATE statements can run in two places:
Execution surfaceWhen to use
NQL query endpointAd-hoc updates from an API client or Data Studio
ExecuteDml workflow taskScheduled or event-driven updates inside a workflow
Running UPDATE without a WHERE clause modifies every row in the target dataset. Review the statement — or run the corresponding SELECT with the same predicate first — before executing.

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