VeloDB Cloud 26.xยทApache Doris 4.x (up to 4.0 supported)ยท"Since X.Y" tags refer to Apache Doris versionsVersion mapping
Comparison Operators
Descriptionโ
Comparison conditions compare one expression with another. The result of the comparison can be TRUE, FALSE, or UNKNOWN.
Operator Introductionโ
| Operator | Function | Example |
|---|---|---|
= | Equality comparison. If either side of the comparison is UNKNOWN, the result is UNKNOWN. | SELECT 1 = 1 |
<=> | NULL-safe equality comparison. Unlike equality comparison, NULL-safe equality treats NULL as a comparable value. Returns TRUE when both sides are NULL. Returns FALSE when only one side is NULL. This operator never returns UNKNOWN. | SELECT NULL <=> NULL |
!= <> | Inequality comparison | SELECT 1 != 1 |
< > | Greater than and less than comparison | SELECT 1 > 1 |
<= >= | Greater than or equal to and less than or equal to comparison | SELECT 1 >= 1 |
<x> BETWEEN <y> AND <z> | Equivalent to <x> >= <y> and <x> <= <z>. Greater than or equal to <y> and less than or equal to <z> | SELECT 1 BETWEEN 0 AND 2 |