The SQL WHERE Clause
The SQL WHERE Clause
WHERE Clause
❮ PreviousNext ❯
WHERE Syntax
SELECT column1, column2, ...
FROM table_name
WHERE condition;
Note: The WHERE clause is not only used in SELECT statements, it is also used
in UPDATE, DELETE, etc.!
Demo Database
Below is a selection from the "Customers" table in the Northwind sample
database:
Example
SELECT * FROM Customers
WHERE Country='Mexico';
Try it Yourself »
Example
SELECT * FROM Customers
WHERE CustomerID=1;
Try it Yourself »
Operator Description
= Equal
<> Not equal. Note: In some versions of SQL this operator may be writte
=
BETWEEN Between a certain range