Skip to main content
The DELETE statement removes rows from a dataset. A WHERE clause restricts which rows are removed.
DELETE runs against datasets you own. To drop an entire dataset rather than delete rows, delete the dataset through the platform UI or API.

Syntax

DELETE FROM table_reference
[WHERE condition]
  • The WHERE clause is optional. If omitted, every row in the dataset is removed. The dataset itself remains but is empty.
  • The WHERE condition can reference any column on the target dataset and use any NQL operators or functions.

Examples

Delete a single row by key:
DELETE FROM company_data."123"
WHERE user_id = 42
Delete rows matching a condition:
DELETE FROM company_data.pipeline_log
WHERE
  status = 'stale'
  AND created_at < CURRENT_TIMESTAMP - INTERVAL '90' DAY
Delete rows with null required fields:
DELETE FROM company_data."123"
WHERE email IS NULL

Execution context

DELETE statements can run in two places:
Execution surfaceWhen to use
NQL query endpointAd-hoc deletes from an API client or Data Studio
ExecuteDml workflow taskScheduled or event-driven deletes inside a workflow
DELETE is irreversible. Running DELETE FROM table_reference without a WHERE clause empties the dataset. Run the equivalent SELECT with the same predicate first to confirm exactly which rows will be removed.

INSERT

Add rows to a dataset

UPDATE

Modify existing rows in a dataset

SELECT

Preview rows before deleting

ExecuteDml workflow task

Run DML statements from a workflow