Difference between time intervals in QuestDb

Viewed 82

In QuestDb can someone explain, whats the difference between

SELECT avg(rating) FROM ratings where 
timestamp in('2005-01-01T00:00:00Z', '2006-01-01T00:00:00Z')

and

SELECT avg(rating) FROM ratings where 
timestamp = '2005;1y'

and

SELECT avg(rating) FROM ratings where 
timestamp = '2005'

because the first select and the last one are equal while the second results differently on my data

1 Answers

First interval timestamp in('2005-01-01T00:00:00Z', '2006-01-01T00:00:00Z') will include full year 2005 and one data point 2006-01-01T00:00:00

Second interval timestamp = '2005;1y' actually means full year 2005 + 1 more year. So it is 2005, 2006 up to 2006-12-31 23:59:59.9999 inlcusivly

Third interval timestamp = '2005' is just year 2005 from 2005-01-01 to 2005-12-31 23:59:59.999999

Related