---
title: Delete predicate syntax
description: InfluxDB uses an InfluxQL-like predicate syntax to determine what data points to delete.
url: https://docs.influxdata.com/influxdb/v2/reference/syntax/delete-predicate/
estimated_tokens: 1062
product: InfluxDB OSS v2
version: v2
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb/v2/reference/syntax/delete-predicate/
date: '2025-04-02T15:54:32-06:00'
lastmod: '2025-04-02T15:54:32-06:00'
---

This page documents an earlier version of InfluxDB OSS.[InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a
copy of the database file doesn’t expose usable tokens. Existing
tokens are hashed on first startup and the original strings can’t
be recovered afterward — **capture any plaintext tokens you still
need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

InfluxDB uses an InfluxQL-like predicate syntax to determine what data[points](/influxdb/v2/reference/glossary/#point) to delete.
InfluxDB uses the delete predicate to evaluate the [series keys](/influxdb/v2/reference/glossary/#series-key)of points in the time range specified in the delete request.
Points with series keys that evaluate to `true` for the given predicate are deleted.
Points with series keys that evaluate to `false` are preserved.

A delete predicate is comprised of one or more [predicate expressions](/influxdb/v2/reference/glossary/#predicate-expression).
The left operand of the predicate expression is the column name.
The right operand is the column value.
Operands are compared using [comparison operators](#comparison-operators).
Use [logical operators](#logical-operators) to combine two or more predicate expressions.

##### Example delete predicate

```sql
key1="value1" AND key2="value"
```

#### Predicates with special characters or keywords

If your predicate contains keywords or strings with special characters, wrap each in escaped
quotes to ensure the predicate string is parsed correctly.

Because delete predicates follow [InfluxQL](/influxdb/v2/reference/syntax/influxql) syntax, [any InfluxQL keyword](/influxdb/v2/reference/syntax/influxql/spec/#keywords)that matches your tag name needs to be escaped. Keywords are case-insensitive.

```js
// Escaped due to the "-"
"_measurement=\"example-dash\""

// Escaped because "Name" is a keyword
"_measurement=example and \"Name\"=predicate"
```

#### Column limitations when deleting data

**InfluxDB 2.9** supports deleting data by any column or tag***except*** the following:

* `_time`

* `_field`

* `_value`

*InfluxDB 2.9 does not support deleting data **by field**.*

## Logical operators

Logical operators join two or more predicate expressions.

|Operator|                                Description                                 |
|--------|----------------------------------------------------------------------------|
| `AND`  |Both left and right operands must be `true` for the expression to be `true`.|

## Comparison operators

Comparison operators compare left and right operands and return `true` or `false`.

|Operator|Description|   Example   |Result|
|--------|-----------|-------------|------|
|  `=`   | Equal to  |`"abc"="abc"`|`true`|

## Delete predicate examples

* [Delete points by measurement](#delete-points-by-measurement)

* [Delete points by tag set](#delete-points-by-tag-set)

### Delete points by measurement

The following will delete points in the `sensorData` measurement:

```sql
_measurement="sensorData"
```

### Delete points by tag set

The following will delete points from the `prod-1.4` host in the `us-west` region:

```sql
host="prod-1.4" AND region="us-west"
```

## Limitations

The delete predicate syntax has the following limitations.

* Delete predicates do not support regular expressions.
* Delete predicates do not support the `OR` logical operator.
* Delete predicates only support equality (`=`), not inequality (`!=`).
* Delete predicates can use any column or tag **except** `_time`, `_field`,
  or `_value`.

#### Related

* [Delete data](/influxdb/v2/write-data/delete-data/)
* [influx delete](/influxdb/v2/reference/cli/influx/delete/)

[syntax](/influxdb/v2/tags/syntax/)[delete](/influxdb/v2/tags/delete/)
| Operator | Description |
| --- | --- |
| Operator | Description |
| AND | Both left and right operands must be  true  for the expression to be  true . |

| Operator | Description | Example | Result |
| --- | --- | --- | --- |
| Operator | Description | Example | Result |
| = | Equal to | "abc"="abc" | true |
