Last updated: August 27, 2026.
Use BETWEEN to test whether a value falls inside an inclusive range. It works with numbers, dates, and other ordered data types.
Syntax
SELECT column_list
FROM table_name
WHERE column_name BETWEEN lower_value AND upper_value;Example
SELECT EmployeeIDNo, Salary
FROM EmployeeStatisticsTable
WHERE Salary BETWEEN 30000 AND 50000;Both endpoints are included. For timestamp columns, a half-open range such as created_at >= start AND created_at < next_day is often clearer than relying on an end-of-day value.
See the current PostgreSQL SQL reference; confirm dialect details for your own database.