ABAP - Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL →  Open SQL - Operands and Expressions →  Open SQL - Conditions sql_cond → 

sql_cond - rel_exp for Statements

Quick Reference

Syntax

... { {operand1 {=|EQ|<>|NE|>|GT|<|LT|>=|GE|<=|LE}
                  {  operand2
                  | {[ALL|ANY|SOME] ( SELECT subquery_clauses [ UNION ...] )} }}
    | {operand [NOT] BETWEEN operand1 AND operand2}
    | {operand1 [NOT] LIKE operand2 [ESCAPE esc]}
    | {operand [NOT] IN (operand1, operand2 ...)}
    | {operand [NOT] IN @seltab}
    | {operand IS [NOT] NULL}
    | {(cond_syntax)}
    | { EXISTS ( SELECT subquery_clauses [UNION ...] )}
    | {operand [NOT] IN ( SELECT subquery_clauses [UNION ...] )} } ...

Effect

Relational expression in a condition of an Open SQL statement. Logical expressions sql_cond can be formed from the relational expressions shown here for the following conditions:

The possible operands of a relational expression are columns and SQL expressions, which covers literals, host variables, and host expressions. The category of the expression and where it is used determine which operands can be used and where. The following principles apply:

A relational expression rel_exp is either true, false, or unknown. The expression is unknown if one of the columns involved in the database contains a null value and is evaluated with another comparison as IS NULL. The result of joins of relational expressions with unknown results is described under AND, OR, NOT.

In an SQL condition of a statement, the client column of a client-specific data source of a query or of the target of a write statement can be used as an operand only if automatic client handling is switched off using the addition CLIENT SPECIFIED for the query or write. This is checked in full in the strict modes of the syntax check from Release 7.40, SP05.

Notes



Continue
sql_cond - Relational Operators
sql_cond - BETWEEN
sql_cond - LIKE
sql_cond - IN ( ..., ... )
sql_cond - IN seltab
sql_cond - IS NULL
sql_cond - EXISTS
sql_cond - IN subquery
sql_cond - (cond_syntax)
sql_cond - subquery_clauses