Comparison Functions and Operators Overview

NameDescription
>Greater than operator
>=Greater than or equal operator
<Less than operator
<>,!=Not equal operator
<=Less than or equal operator
=Equal operator
BETWEEN … AND …Whether a value is within a range of values
COALESCEReturn the first non-null value in a list
IN()Whether a value is within a set of values
ISTest a value against a boolean
IS NOTTest a value against a boolean
IS NOT NULLNOT NULL value test
IS NULLNULL value test
ISNULLNULL value test
LIKESimple pattern matching
ILIKESimple pattern matching. Same as LIKE. But it is not case sensitive.
NOT BETWEEN … AND …Whether a value is not within a range of values
NOT INshorthand for multiple XOR conditions.
NOT LIKENegation of simple pattern matching

Comparison operations result in a value of TRUE, FALSE, or NULL. These operations work for both numbers and strings. Strings are automatically converted to numbers and numbers to strings as necessary.

The following relational comparison operators can be used to compare not only scalar operands, but row operands:

  1. = > < >= <= <> !=