The relational operators (=, <>, <, >, <=, and >=) compare two operands. All of the relational operators result in a Boolean value.
The relational operators have the following general meaning:
- The = operator tests whether two operands are equal.
- The <> operator tests whether two operands are not equal.
- The < operator tests whether the first operand is less than the second operand.
- The > operator tests whether the first operand is greater than the second operand.
- The <= operator tests whether the first operand is less than or equal to the second operand.
- The >= operator tests whether the first operand is greater than or equal to the second operand.
The equality operators are defined for all types. The non-equality operators are only defined for the numeric and string types.
Note: You cannot compare string values to numeric values.
The following table shows examples of the relational operators.
Operand Type |
Example |
Result |
Number and Integer |
3.0 = 3 |
True |
Numbers |
34 <= 29.0 |
False |
Numbers |
12 <> 8 |
True |
Strings |
"Name" = "name" |
True |
Points |
Point(3,0,0) = Point(0,3,0) |
False |