... cond1 AND cond2 AND cond3 ...
Link with the logical operator AND.
... cond1 OR cond2 OR cond3 ...
Link with the logical operator OR.
... NOT cond ...
Negation with the logical operator NOT.
Any number of logical expressions can be linked to a logical expression using AND or OR and the result of a logical expression can be negated using NOT. The same rules apply as for general logical expressions. In particular an explicit use of parantheses is also possible.
For logical expressions, of which the result is unknown, the following additional rules apply:
In particular, the expressions specified dynamically as (cond_syntax), are also possible as logical expressions within a link or negation.
Read flights from Frankfurt to Los Angeles or San Francisco.
DATA spfli_tab TYPE TABLE OF spfli.
SELECT *
FROM spfli
INTO TABLE spfli_tab
WHERE cityfrom = 'FRANKFURT' AND
( cityto = 'LOS ANGELES' OR
cityto = 'SAN FRANCISCO' ).