Filter Expression Syntax Reference

Query filter expressions have the following form.

[ NOT ] column operator value { [ AND | OR ] [ NOT ] column operator value }*

The following sections describe further details of filter expression syntax and semantics.

Column

column can be the name of any column defined in the table.

Operator

operator can be any operator in the following table:
Operator Description
=

==

IS

!=

<>

IS NOT

>
<
>=
<=
ISNULL

IS NULL

Tests that the row does not contain a value in this column.
NOTNULL

NOT NULL

IS NOT NULL

Tests that the row contains a value in this column.
BETWEEN value_1 and value_2 Requires two values, separated by the keyword and. The range includes the end values.
IN ( value [, value ]* ) Requires a set of values, separated by commas, surrounded by parentheses.

Value

value can be any value of the same data type as the column's data type.

Surround string values in single quote characters: for example, 'My Value'.

Conjunctions

  • AND joins multiple conditions. The overall condition is true if and only if every individual condition is true.
  • OR joins multiple conditions. The overall condition is true if at least one of the individual conditions is true.

Negation

NOT reverses the boolean value of a logical expression that follows it. For example, you can use the operators NOT BETWEEN and NOT IN.

You can also precede an operator clause with NOT, for example:
NOT column operator value

Order of Operations

Order of operations is similar to SQL. NOT takes precedence over conjunctions. The conjunction AND takes precedence over OR.

You can use parentheses to group expressions, overriding that order.

Performance

See Efficiency of Filters.