Ranges

PRQL has a concise range syntax start..end.

This can be used in filters with the in function, with any type of literal, including dates:

PRQL

from events
filter (date | in @1776-07-04..@1787-09-17)
filter (magnitude | in 50..100)

SQL

SELECT
  events.*
FROM
  events
WHERE
  date 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 in take:

PRQL

from orders
sort [-value, date]
take 101..110

SQL

SELECT
  orders.*
FROM
  orders
ORDER BY
  value DESC,
  date
LIMIT
  10 OFFSET 100

Roadmap

We’d like to use this for more like whether an object is in an array or list literal.