0

我目前正在做类似的查询

where startTs > '2021-04-18T00:00:00.000000Z'
      and startTs <= '2021-05-17T00:00:00.000000Z'

这不是 1 个月的数据,而是大约 25 天的间隔。我想知道是否有更短的语法来查询 QuestDB 中的时间戳之间的数据。

4

1 回答 1

0

较短的语法是

where startTs > '2021-04-18'
      and startTs <= '2021-05-17'

所以0时间是可选的。时间可以指定到任何精度

where startTs > '2021-04-18T12'
      and startTs <= '2021-05-17T12'

也有特殊的语法来查询 29 天的间隔,但它包括开始微秒,2021-04-18T00:00:00.000000Z不包括结束微秒2021-05-17T00:00:00.000000Z

where startTs IN '2021-04-18;29d'
于 2021-05-27T23:08:03.990 回答