PRQL has a concise range syntax
start..end. If only one of
supplied, the range is open on the empty side.
Ranges can be used in filters with the
in function, with any type of literal,
from events filter (created_at | in @1776-07-04..@1787-09-17) filter (magnitude | in 50..100) derive is_northern = (latitude | in 0..)
SELECT *, latitude >= 0 AS is_northern FROM events WHERE created_at BETWEEN DATE '1776-07-04' AND DATE '1787-09-17' AND magnitude BETWEEN 50 AND 100
Like in SQL, ranges are inclusive.
As discussed in the take docs, ranges can also be used
from orders sort [-value, created_at] take 101..110
SELECT * FROM orders ORDER BY value DESC, created_at LIMIT 10 OFFSET 100
We’d like to use ranges for other types, such as whether an object is in an array or list literal.