SQLite WHERE clause

In SQLite the WHERE clause can be used to filter data. The WHERE clause is used to define a criteria that search results must satisfy.

Below is a simple example implementing the WHERE clause in a SELECT query in SQLite.

SELECT name, revenue
FROM customers
WHERE priority > 3;

This query will return names and revenues for all customers that have a priority score of above 3.

Local comparison operators for SQLite WHERE clause

The SQLite WHERE clause supports the following logical comparison operations:

  • = equal
  • < less than
  • > greater than
  • != not equal
  • <> not equal
  • <= less than or equal
  • >= greater than or equal

Local operators for SQLite WHERE clause

The SQLite WHERE clause supports the following logical operators:

ALLTrue if all expressions are true
ANDTrue if both expressions are true (2 expressions)
ANYTrue if at least one out of multiple expressions is true
BETWEENTrue if specified value is within specified range
EXISTSTrue if subquery has at least one entry
INTrue if a value is found within specified list of possible values
LIKETrue if a value matches a specified pattern
NOTUsed for negation
ORTrue if one of two expressions is true