bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL Tutorial
SQL•SQL Tutorial

SQL AND Operator

Concept visual

SQL AND Operator

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

Start at both ends

The SQL AND Operator

The WHERE

clause can contain one or many

And

operators.

The AND

operator is used to filter records based on more than one condition.

Note:

The AND

operator displays a record if all the conditions are TRUE. The following SQL selects all customers from Spain that starts with the letter 'G':

Example

Select all customers where Country is "Spain" AND CustomerName starts with the letter 'G':

SELECT *

FROM Customers

WHERE Country = 'Spain' AND CustomerName LIKE 'G%';

AND Syntax

Select

column1, column2, ...

From

table_name

Where

condition1

And

condition2

And

condition3 ...

;

Demo Database

Below is a selection from the

Customers table used in the examples:

CustomerID

CustomerName

ContactName

Address

City

PostalCode

Country

Alfreds Futterkiste

Previous

SQL ORDER BY Keyword

Next

SQL OR Operator