Comparison Operators
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
Comparison operators compare one expression to another. The result of such a comparison can be TRUE, FALSE, or UNKNOWN (if one of the operands is NULL). The Salesforce driver considers the UNKNOWN result as FALSE. The following table lists the supported comparison operators.
| Operator | Purpose | Example |
|---|---|---|
| = | Equality test. |
|
| != <> | Inequality test. |
|
| > < | “Greater than" and "less than" tests. |
|
| >= <= | “Greater than or equal to" and "less than or equal to" tests. |
|
| [NOT] IN | “Equal to any member of" test. |
|
| [NOT] BETWEEN x AND y | "Greater than or equal to x" and "less than or equal to y." |
|
| EXISTS | Tests for existence of rows in a subquery. |
|
| IS [NOT] NULL | Tests whether the value of the column or expression is NULL. |
|
| ESCAPE clause in LIKE operatorLIKE ’pattern string’ ESCAPE ’c’ | The Escape clause is supported in the LIKE predicate to indicate
the escape character. Escape characters are used in the pattern string to indicate
that any wildcard character that is after the escape character in the pattern string
should be treated as a regular character. The default escape character is backslash (\). |
This
matches all records with names that start with letter 'J' and have the '_' character
in
them.This
matches only records with name ’JOE_JOHN’. |