Using a Condition in the WHERE Clause

You can use these simple conditions or comparisons in the WHERE clause:
  • Relational-operator condition
  • IN or BETWEEN . . . AND
  • IS NULL or IS NOT NULL
  • LIKE or MATCHES
You also can use a SELECT statement within the WHERE clause; this is called a subquery. The following WHERE clause operators are valid in a subquery:
  • IN or EXISTS
  • ALL, ANY, or SOME

For more information, see Condition.

In the WHERE clause, an aggregate function is not valid unless it is part of a subquery or is on a correlated column originating from a parent query, and the WHERE clause is in a subquery within a HAVING clause.