Chapter 10. Operators

Table of Contents

Logical Operators
Value Comparison Operators
Sequence Comparison Operators
IS NULL Operator
Exists Operator
Is-Of-Type Operator

This chapter describes the various operators you can use with your SQL expressions.

Note

The examples shown in this chapter rely on the sample data shown in Example Data.

Logical Operators

The binary AND and OR operators and the unary NOT operator have the usual semantics. Their operands are conditional expressions, which must have type BOOLEAN.

An empty result from an operand is treated as the false value. If an operand returns NULL then:

  • The AND operator returns false if the other operand returns false; otherwise, it returns NULL.

  • The OR operator returns false if the other operand returns false; otherwise, it returns NULL.

  • The NOT operator returns NULL.