Ansicht
Dokumentation

ABENWHERE_LOGEXP_ANDORNOT - WHERE LOGEXP ANDORNOT

ABENWHERE_LOGEXP_ANDORNOT - WHERE LOGEXP ANDORNOT

ROGBILLS - Synchronize billing plans   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.
SAP E-Book

Short Reference

- AND, OR, NOT, ( )

... sql_cond1 AND sql_cond2 AND sql_cond3 ...

... sql_cond1 OR sql_cond2 OR sql_cond3 ...

... NOT sql_cond ...

... ( sql_cond ) ...

Effect

Any number of logical sql_cond expressions can be combined into one logical expression using AND or OR and the result of a logical expression can be negated using NOT. The same rules apply as to general logical expressions, with the difference that the operator NOT cannot be specified more than once in direct succession. In particular, the explicit use of ( ) parentheses is also possible.

In SQL, the order in which two expressions are evaluated that are combined by AND is not defined. Results can be different on different database platforms.

The following additional rules apply to logical expressions whose result is unknown because an operand has the null value:

  • An AND combination of two unknown expressions or a true expression with an unknown expression produces an unknown expression. An AND combination of a false expression with an unknown expression produces a false expression.
  • An OR combination of two unknown expressions or one false expression with an unknown expression produces an unknown expression. An OR combination of one true and one unknown expression produces a true expression.
  • The negation of an unknown expression with NOT produces an unknown expression.

Notes

  • In particular, the expressions specified dynamically as (cond_syntax) are also possible as logical expressions within a combination or negation.
  • The operator NOT in a WHERE clause cannot be supported by an index. For this reason, it is best to use the reverse comparison operator instead of NOT, for example col = dobj instead of NOT col > dobj.
  • Two NOT operators can only be specified consecutively if they are separated by an opening parenthesis. If not, an even number of consecutive NOT operators has the same meaning as none, and an odd number of consecutive NOT operators has the same meaning as a single NOT and should be used accordingly.
  • If several expressions are combined by AND, you cannot rely on rules such as: If one expression is false, then the following expressions are not evaluated any more. For example a condition col1 <> 0 AND col2 / col1 > 1 can lead to an exception. To avoid such exceptions, CASE expressions can be used.

Example

Reading of flights from Frankfurt to Los Angeles or San Francisco.






SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 3694 Date: 20240426 Time: 145420     sap01-206 ( 62 ms )