ABAP Keyword Documentation → ABAP - Quick Reference
sql_cond - Quick reference
Other versions: 7.31 | 7.40 | 7.54
Syntax
... { {operand1 {=|EQ|<>|NE|>|GT|<|LT|>=|GE|<=|LE}
{ operand2
| {[ALL|ANY|SOME] ( SELECT
subquery [UNION ...] )} }}
| {operand [NOT] BETWEEN operand1 AND operand2}
| {operand1 [NOT] LIKE operand2 [ESCAPE esc]}
| {operand IS [NOT] NULL}
| {operand IS [NOT] INITIAL}
| {EXISTS ( SELECT
subquery [UNION ...] )}
| {operand [NOT] IN (operand1, operand2 ...)}
| {operand [NOT] IN ( SELECT
subquery [UNION ...] )}
| {( operand1, operand2, ... ) IN ( ( operand11, operand21 ... ),
( operand12, operand22 ... ), ... )}
| {operand [NOT] IN @range_tab}
| {(cond_syntax)} } ...
Effect
Condition for the content of columns after the additions WHERE
, ON
, or HAVING
in
ABAP SQL statements. The left-hand
side can be specified as an SQL expression. Conditions can be put in parentheses explicitly, joined
using AND
and OR
, and negated using NOT
.
Additions
-
=|EQ|<>|NE|>|GT|<|LT|>=|GE|<=|LE
Relational operators: Column content can be compared with host variables, with host expressions, with the content of other columns, and with the result of a subquerysubquery
. -
ALL|ANY|SOME
Must be specified when the results of the subquerysubquery
has more than one line. -
[NOT] BETWEEN
Checks whether the content of the left side is in an interval. -
[NOT] LIKE operand2 #[ESCAPE esc]
Checks whether the content of the left side matches the pattern inoperand2
. Here, an escape character esc can be defined with for the wildcard characters "%" and "_" usingESCAPE
. -
IS [NOT] NULL
Checks whether the content of the left side has the null value. -
IS [NOT] INITIAL
Checks whether the content of the left side is the initial values of its built-in dictionary type. -
EXISTS subquery
Checks the results set of the subquerysubquery
. -
operand [NOT] IN (operand1, operand2 ...)
Checks whether the content of an operand on the left side is in a value listoperand1, operand2, ...
-
operand [NOT] IN subquery
Checks whether the content of the left side is in the results set of the scalar subquerysubquery
. -
( operand1, operand2 ) IN ( ( operand11, operand21 ... ), ... )
Checks whether the content of a list of operands is in a value listoperand1, operand2, ...
-
[NOT] IN range_tab
Checks whether the content of the left side meets the conditions of a ranges tablerange_tab
. -
(cond_syntax)
Condition incond_syntax
specified dynamically.