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:
ALL | True if all expressions are true |
AND | True if both expressions are true (2 expressions) |
ANY | True if at least one out of multiple expressions is true |
BETWEEN | True if specified value is within specified range |
EXISTS | True if subquery has at least one entry |
IN | True if a value is found within specified list of possible values |
LIKE | True if a value matches a specified pattern |
NOT | Used for negation |
OR | True if one of two expressions is true |