Relational Operators
- Last Updated: October 5, 2020
- 1 minute read
- DataDirect Connectors
- ODBC
- Cloudera Impala 7.1
- dBase 7.1
- Flat files/Text 7.1
- MySQL 7.1
- Pervasive (Btrieve) 7.1
- XML 7.1
- Documentation
Relational Operators
Relational operators separating any two expressions can be any one of those listed in the following table.
| Operator | Meaning |
|---|---|
| = | Equal. |
| <> | Not Equal. |
| > | Greater Than. |
| >= | Greater Than or Equal. |
| < | Less Than. |
| <= | Less Than or Equal. |
| Like | Matching a pattern. |
| Not Like | Not matching a pattern. |
| Is NULL | Equal to NULL. |
| Is Not NULL | Not Equal to NULL. |
| Between | Range of values between a lower and upper bound. |
| In | A member of a set of specified values or a member of a subquery. |
| Exists | True if a subquery returned at least one record. |
| Any | Compares a value to each value returned by a subquery. Any must be prefaced by =, <>, >, >=, <, or <=.=Any is equivalent to In. |
| All | Compares a value to each value returned by a subquery. All must be prefaced by =, <>, >, >=, <, or <=. |
The following list shows some examples of relational operators:
salary <= 40000
dept = 'D101'
hire_date > {01/30/1989}
salary + commission >= 50000
last_name LIKE 'Jo%'
salary IS NULL
salary BETWEEN 10000 AND 20000
WHERE salary = ANY (SELECT salary FROM emp WHERE dept = 'D101')
WHERE salary > ALL (SELECT salary FROM emp WHERE dept = 'D101')