Between

SQL BETWEEN

The BETWEEN keyword returns records between two values.

Syntax

SELECT * FROM name_of_table WHERE name_of_column BETWEEN value1 AND value2;

Example

Table of books

IDNAMEPRICE
1Learn Python45
2MySQL Tutorial32
3PHP examples24
4Learn SQL32
SELECT * FROM books WHERE price BETWEEN 30 AND 45;

Output

IDNAMEPRICE
1Learn Python45
2MySQL Tutorial32
4Learn SQL32