SQL and
SQL and
« Previous
Next Chapter »
The AND & OR operators are used to filter records based on more than one condition.
The OR operator displays a record if either the first condition OR the second condition is
true.
Demo Database
In this tutorial we will use the well-known Northwind sample database.
Try it yourself »
OR Operator Example
The following SQL statement selects all customers from the city "Berlin" OR "München", in
the "Customers" table:
Example
SELECT * FROM Customers
WHERE City='Berlin'
OR City='München';
Try it yourself »
The following SQL statement selects all customers from the country "Germany" AND the
city must be equal to "Berlin" OR "München", in the "Customers" table:
Example
SELECT * FROM Customers
WHERE Country='Germany'
AND (City='Berlin' OR City='München');
Try it yourself »
« Previous
Next Chapter »