SQLite AND Operator
The AND Operator
A WHERE clause can have more than one condition. With AND, a record is returned only if all the conditions are true.
This example selects the customers from Germany that are in Berlin:
More Than Two Conditions
You can use as many AND operators as you need. This example selects the products in category 1 with a price between 15 and 20:
Example
SELECT * FROM Products
WHERE CategoryID = 1
AND Price > 15
AND Price < 20;
Try it Yourself »
AND and OR Together
When you use AND and OR together, use parentheses to say what belongs together. This example selects the customers from Spain that are in Madrid or Sevilla:
Example
SELECT * FROM Customers
WHERE Country = 'Spain'
AND (City = 'Madrid' OR City = 'Sevilla');
Try it Yourself »
You will learn more about OR in the next chapter.