Predicates are components of search conditions. A predicate consists of operands and operators.
Predicates can be grouped together as follows according to the operator involved:
Comparison of two rows
Two rows are compared lexicographically according to a comparison operator. If both rows only have one column, you will obtain the normal comparison of two values. The following comparison operators are allowed:=
equal to
<
smaller than
<=
smaller than or equal to
>
greater than
>=
greater than or equal to
<>
not
Quantified comparison (comparison with the rows of a table)
The value of a row is compared with the rows of a table. It is determined whether the comparison holds true either for all the rows of the table, or else for at least one row (SOME/ANY).BETWEEN predicate (range query)
It is determined whether the row lies within a range (BETWEEN) or outside a range (NOT BETWEEN), specified its lower and upper limits.CASTABLE predicate (convertibility check)
This checks whether an expression can be converted to a particular data type. The CASTABLE predicate enables you to check whether a corresponding CAST expression (see section “CAST expression”) can be executed before it is executed and to react appropriately.IN predicate (elementary query)
This determines whether a row occurs in a table (IN) or does not occur in a table (NOT IN).LIKE predicate (simple pattern comparison)
A LIKE predicate determines whether an alphanumeric or a national value matches a specified pattern.LIKE_REGEX predicate (pattern comparison with regular expressions)
A check is made to see whether an alphanumeric value matches a specified regular expression. Regular expressions are precisely defined search patterns which go far beyond the options of the search patterns in the LIKE predicate. Regular expressions are a powerful means of searching large data sets for complex search conditions. They have long been used, for example, in the Perl programming language.NULL predicate (comparison with the NULL value)
A check is made to see whether a column, a parameter or a local variable contains the NULL value.EXISTS predicate (existence query)
This checks whether the specified derived table contains values.
The data types of the operands must be comparable.
All numeric values can be compared with other numeric values, all alphanumeric strings can be compared with other alphanumeric strings and all national strings can be compared with other national strings. Date, time and datetime can only be compared with date, time and datetime respectively.