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:

This means that the behavior produced when a value of this type is selected using size comparisons is determined by the platform and by buffering. More specifically, a single blank in the SAP HANA database and in MaxDB is not found in the interval of all possible characters.

Notes

Example

Gets flights with a seat occupancy that is less than the entered value.

DATA seatsocc TYPE sflight-seatsocc.
cl_demo_input=>request( CHANGING field = seatsocc ).

SELECT carrid, connid, fldate
       FROM sflight
       WHERE seatsocc < @seatsocc
       INTO TABLE @DATA(sflight_tab).

Example

Gets overbooked flights.

SELECT carrid, connid, fldate
       FROM sflight
       WHERE seatsocc > sflight~seatsmax
       INTO TABLE @DATA(sflight_tab).