#6878·questdb

EARLIEST ON keywords

Author: pockets3407Created Mar 16, 2026Updated Oct 1, 2026
LabelsNew feature

Is your feature request related to a problem?

I am storing data in a table as time-series database. I need to fetch the first value "at or after" or "after" a specified timestamp.

For before or at or before, I can do this inherently with LATEST ON keyword.

Describe the solution you'd like.

I would like a solution to mimic my query for LATEST ON.

SELECT * FROM TimeSeriesHistorian
WHERE symbol IN (1, 2, 3)
AND timestamp > @ Timestamp
EARLIEST ON timestamp PARTITION BY symbol

Describe alternatives you've considered.

Currently, I am using the following and then unioning them together.

SELECT * FROM TimeSeriesHistorian
WHERE symbol = 1
AND timestamp > @ Timestamp
ORDER BY timestamp ASC
LIMIT 1

Full Name:

Andrew Jank

Affiliation:

EtaPRO LLC

Additional context

I am using QuestDB as a time-series database