Code Editor

Query Results

Run a query to see results.

Database Schema

Schema undefined.
Learn
Queries

Between

The BETWEEN operator can be used in a WHERE clause to filter the result set within a certain range. The values can be numbers, text or dates.

This statement filters the result set to only include movies with names that begin with letters 'A' up to but not including 'J'.

SELECT * FROM movies WHERE name BETWEEN 'A' AND 'J';

Here is another one:

SELECT * FROM movies WHERE year BETWEEN 1990 AND 1999;

In this statement, the BETWEEN operator is being used to filter the result set to only include movies with years between 1990 up to and including 1999.

Really interesting point to emphasize again:

  • BETWEEN two letters is not inclusive.
  • BETWEEN two numbers is inclusive.
Report a Bug
If you see a bug or any other issue with this page, please report it here.