SAP NetWeaver AS ABAP Release 750, ©Copyright 2016 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Processing External Data → ABAP Database Accesses → Open SQL → Open SQL - Read Accesses → SELECT → SELECT - WHERE → WHERE - sql_cond →sql_cond - Relational Operators
Syntax
... operand1 operator operand2
| {[ALL|ANY|SOME] subquery} ...
Effect
The relational expression compares the content of the operand operand1 as specified by the relational operator operator
The following table shows the possible relational operators.
| operator | Meaning |
| =, EQ | True if the content of operand1 is equal to the content of operand2. |
| <>, NE | True if the content of operand1 is not equal to the content of operand2. |
| <, LT | True if the content of operand1 is less than the content of operand2. |
| >, GT | True if the content of operand1 is greater than the content of operand2. |
| <=, LE | True if the content of operand1 is less than or equal to the content of operand2. |
| >=, GE | True if the content of operand1 is greater than or equal to the content of operand2. |
Note the following when using these operators:
Columns and numeric SQL expressions can be specified for operand. This covers the corresponding literals, host variables, and host expressions.
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).