Predicates

Predicates

In our simplified BNF, predicate can be defined as a statement that can be evaluated to either TRUE or FALSE. Table H-2 "decodes" SQL syntax for predicates.

Table H-2: Predicates

Element

Syntax

<predicate>

<boolean_term> [{AND | OR} <boolean_term>,...]

<boolean_term>

[NOT] <search_test>

<search_test>

<comparison_test> | <between_test> |
<in_test> |
<like_test> |
<null_test> |
<exists_test> |
<quantified_comparisson_test>

<comparison_test>

<column_value>
{= | <> | != | < | > | <= | >=}
{<expression> | <single_row_subquery>}

<between_test>

<column_value>
[NOT] BETWEEN
<expression> AND <expression>

<in_test>

<column_value> [NOT] IN <expression_list> | <table_subquery>

<like_test>

<column_value> [NOT] LIKE <pattern> [ESCAPE <value>]

<null_test>

<column_value> IS [NOT] NULL

<exists_test>

EXISTS <table_subquery>

<quantified_ comparisson_test>

<column_value>
{= | <> | != | < | > | <= | >=}
{ALL | SOME | ANY}
<table_subquery>

<expression_list>

(<expression>,...)

<expression>

<sub-expression>
{+ | - | * | /}
<sub-expression>

<sub-expression>

[- | +] {<value> | <function>}

<value>

<literal> | <variable>

<column_value>

[qualifier.]<column_name>