Literal Value Comparison

The literal value comparison uses standard comparison operators for matching a single-valued column to a literal value. For information about comparing multi-valued columns, see Multi-valued (ARRAY) Comparisons.

The following example shows the literal value comparison predicate syntax:

…WHERE <column> <comp_op> <literal>

Note The right side of the comparison must be a literal. You cannot compare a column against a computed value, and you cannot compare a column against another column.

The column part can be any valid column, and can be type-cast if necessary. For more information, see Casting the Data Type of a Column.

The literal can be any string, numeric, hexadecimal, Boolean, or date literal. Only exact matches are allowed, and wildcards are ignored. The literal can also be type-cast.

The following table describes the supported comparison operators.

Comp_op Description
= Equal to
!= or <> Not equal to
> Greater than
>= Greater than or equal to
< Less than
<= Less than or equal to

Examples

The following are examples of the literal value comparison predicate.

…WHERE
"urn:schemas-microsoft-com:office:office#Group" = 'Accounting'

…WHERE
"urn:schemas-microsoft-com:publishing:IsCurrentVersion" != TRUE

…WHERE
size >= 10000

Full-Text Predicates

LIKE Predicate

DATEADD Function

MATCHES Predicate

Multi-valued (ARRAY) Comparisons

NULL Predicate