Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Processing External Data →  ABAP - Database Accesses →  Open SQL →  Open SQL - Read Accesses →  SELECT →  SELECT - cond 

WHERE - sql_cond

Short Reference

Other versions: 7.31 | 7.40 | 7.54


... { {col1 {=|EQ|<>|NE|>|GT|<|LT|>=|GE|<=|LE} 
              { {dobj}
              | {col2}
              | {[ALL|ANY|SOME] subquery} }}
    | {col [NOT] BETWEEN dobj1 AND dobj2}
    | {col [NOT] LIKE dobj [ESCAPE esc]}
    | {col [NOT] IN (dobj1, dobj2 ...)}
    | {col [NOT] IN seltab}
    | {col IS [NOT] NULL}
    | {(cond_syntax)}
    | {[NOT] EXISTS subquery}
    | {col [NOT] IN subquery} } ... .


The logical expressions sql_cond in the WHERE condition are similar to the general logical expressions for control statements. There are logical expressions with relational operators and with predicates. Additionally, the logical expressions of a WHERE condition can be dynamiically specified and the use of subqueries is possible. Multiple logical expressions of a WHERE condition can be made into one expression with AND or OR. A single logical expression can be negated usingNOT

Each individual logical expression of the WHERE condition must always contain at least one column col from one of the database tables or views listed after FROM as an operand. You can specify the same column names (comp, dbtab~comp, tabalias~comp) for col as are listed in the specification of single columns after SELECT. You cannot specify aggregate expressions.


sql_cond - Relational operators

sql_cond - BETWEEN

sql_cond - LIKE

sql_cond - IN

sql_cond - IN seltab

sql_cond - NULL

sql_cond - (cond_syntax)

sql_cond - subquery

sql_cond - AND, OR, NOT