ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP Database Accesses →  Open SQL →  Open SQL - Read Accesses →  SELECT →  SELECT - WHERE →  WHERE - sql_cond → 

Short Reference

sql_cond - Relational Operators

Syntax

... col1 operator {dobj}
                | {col2}
                | {[ALL|ANY|SOME] subquery} ...

Effect

The relational expression compares the content of the column col1 with the content of one of the following operands, in accordance with the relational operator operator:

The following table shows the possible relational operators.

operator Meaning
=, EQ True, if the content of col1 is the same as the content of the second operand.
<>, NE True, if the content of col1 is not the same as the content of the second operand.
<, LT True, if the content of col1 is less than the content of the second operand.
>, GT True, if the content of col1 is greater than the content of the second operand.
<=, LE True, if the content of col1 is less than or the same as the content of the second operand.
>=, GE True, if the content of col1 is greater than or the same as the content of the second operand.

Note the following when using these operators:

Note

The obsolete forms ><, =<, and => of relational operators may still appear outside of classes.

Example

Gets overbooked flights.

TYPES: BEGIN OF sflight_tab_type,
         carrid   TYPE sflight-carrid,
         connid   TYPE sflight-connid,
         fldate TYPE sflight-fldate,
       END OF sflight_tab_type.

DATA sflight_tab TYPE TABLE OF sflight_tab_type.

SELECT carrid connid fldate
       FROM sflight
       INTO CORRESPONDING FIELDS OF TABLE sflight_tab
       WHERE seatsocc > sflight~seatsmax.