The WHERE Clause Operators

The first WHERE clause we looked at tests for equality—determining if a column contains a specific value. SQL supports a whole range of conditional operators as listed in Table 4.1.

Table 4.1. WHERE Clause Operators
OperatorDescription
=Equality
<>Non-equality
!=Non-equality
<Less than
<=Less than or equal to
!<Not less than
>Greater than
>=Greater than or equal to
!>Not greater than
BETWEENBetween two specified values
IS NULLIs a NULL value

Operator Compatibility Some of the operators listed in Table 4.1 are redundant (for example, <> is the same as !=. !< (not less than) accomplishes the same effect as >= (greater than or equal ...

Get Sams Teach Yourself SQL in 10 Minutes, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.