🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to PostgreSQL Notes
Topic #28

PostgreSQL BETWEEN


BETWEEN

The BETWEEN operator selects values within a given range. The values can be numbers, text, or dates.

The BETWEEN operator is inclusive: begin and end values are included.

Example

SELECT * FROM Products
WHERE Price BETWEEN 10 AND 15;

BETWEEN Text Values

The BETWEEN operator can also be used on text values.

The result returns all records that are alphabetically between the specified values.

Example

SELECT * FROM Products
WHERE product_name BETWEEN 'Pavlova' AND 'Tofu';

If we add an ORDER BY clause to the example above, it will be a bit easier to read:

Example

SELECT * FROM Products
WHERE product_name BETWEEN 'Pavlova' AND 'Tofu'
ORDER BY product_name;

BETWEEN Date Values

The BETWEEN operator can also be used on date values.

Example

SELECT * FROM orders
WHERE order_date BETWEEN '2023-04-12' AND '2023-05-05';

Want to go beyond the notes?

Join CodingNow 2.0's PostgreSQL course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

PostgreSQL BETWEEN – FAQs

Quick answers about learning PostgreSQL BETWEEN in PostgreSQL.

This free note from CodingNow 2.0 explains PostgreSQL BETWEEN in PostgreSQL — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every PostgreSQL topic on CodingNow 2.0, including PostgreSQL BETWEEN, is 100% free with no signup required.
With focused practice, most students grasp PostgreSQL BETWEEN in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now