zmień kontrast font size: A A A
rss polski
you are at Encyclopedia of SQL >> BETWEEN

BETWEEN

BETWEEN helps us to limit result of query by setting limiting values which can be numbers, strings or date value

Syntax


SELECT `column_name`
FROM `table_name`
WHERE `column_name`
BETWEEN 'limit1' AND 'limit2'

Example

Show name and surname people between age of 3 and 13 years old.

namesurnameage
PawełKowalski3
PiotrJanik7
MichałNowak13

query


SELECT `name`,`surname`
FROM `people` WHERE `age`
BETWEEN 3 AND 13

result

namesurname
PiotrJanik

In some database servers there are displayed limiting values as a result of query and sometimes these values aren't taken to display. Please check your database documentation.
[ wróć na górę strony ]