SQL BETWEEN Operator - example
BETWEEN Syntax
Example 1: WHRE - BETWEEN Syntax
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
FROM table_name
WHERE column_name BETWEEN value1 AND value2;
SQL BETWEEN Operator - how to create - example
Demo Database
Below is a selection from the "Products" table in database:
ID | Product_Name | ID_SUP | ID_CAT | Unit | Price |
---|---|---|---|---|---|
1 | Shirts | 12 | 3 | 20 pieces | 26 |
2 | T-shirts | 12 | 3 | 24 pieces | 11 |
3 | Sport shoes BIC | 14 | 2 | 26 pairs | 36 |
4 | Shoes NiKE | 23 | 1 | 48 pairs | 67 |
5 | Sport shoes BAC | 23 | 1 | 36 pairs | 24.35 |
BETWEEN Example
The following SQL statement from above database selects all products with a price BETWEEN 11 and 21:
Example 1
SELECT * FROM Products
WHERE Price BETWEEN 20 AND 30;
WHERE Price BETWEEN 20 AND 30;
NOT BETWEEN Example
To display the products from database outside the range of the previous example, use NOT BETWEEN:
Example 2
SELECT * FROM Products
WHERE Price NOT BETWEEN 10 AND 20;
WHERE Price NOT BETWEEN 10 AND 20;
Note: The values for BETWEEN can be numbers, text, or dates. The BETWEEN operator in SQL is inclusive: begin and end values are included.
sql between
SQL BETWEEN Operator - sql tutorial
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.