WHERE - Relational operators

Syntax

... col operator f ...

Effect

The logical expression compares the content of the column col, corresponding to the relational operator operator, with the content of f. Another column of a database table specified behind FROM, an ABAP data object as host variable, or a scalar subquery can be used for f. If f is another column, it must be specified via dbtab~comp or tabalias~comp.

The following table shows the possible relational operators.

Operator Meaning
=, EQ True, if the content of col is the same as the content of f.
<>, NE True, if the content of col is different to the content of f.
<, LT True, if the content of col is less than the content of f.
>, GT True, if the content of col is greater than the content of f.
<=, LE True, if the content of col is less than or equal to the content of f.
>=, GE True, if the content of col is greater than or equal to the content of f.

You should note the following when using these operators:

Example

Read overbooked flights.

DATA sflight_tab TYPE TABLE OF sflight.

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