Comparisons: <, >, <=, >=, ==, <>
- Last UpdatedNov 07, 2016
- 1 minute read
These operators compare two values and return TRUE if the condition specified by the operator is met. The operands can be of any data type. For string operands, the comparison is based on alphabetical, non-case-sensitive ordering, with b being greater than a, c greater than b, and so on. For discrete operands, TRUE is considered greater than FALSE. The following table lists all comparison operators along with their conditions:
|
Operation |
Example |
Condition |
|---|---|---|
|
Less than |
a < b |
a is less than b |
|
Greater than |
a > b |
a is greater than b |
|
Less than or equal |
a <= b |
a is less than or equal to b |
|
Greater than or equal |
a >= b |
a is greater than or equal to b |
|
Equal |
a == b |
a is equal to b |
|
Not equal |
a <> b |
a is not equal to b |
Valid operands
Values of any data type (both values must be of the same data type).
Data type of return value
Discrete