bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL WHERE Clause

Concept visual

SQL WHERE Clause

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

The SQL WHERE Clause

The WHERE

clause is used to filter records.

The WHERE

clause is used to extract only those records that fulfill a specific condition.

Example

Here we select all customers from

Mexico

SELECT * FROM Customers
WHERE Country = 'Mexico';

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 used in the examples:

CustomerID

CustomerName

ContactName

Address

City

PostalCode

Country

Alfreds Futterkiste

Maria Anders

Obere Str. 57

Previous

SQL SELECT DISTINCT Statement

Next

SQL ORDER BY Keyword