【问题标题】:Custom timerange in QuestDB?QuestDB 中的自定义时间范围?
【发布时间】:2021-05-27 23:08:03
【问题描述】:

我目前正在做类似的查询

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

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

【问题讨论】:

    标签: questdb


    【解决方案1】:

    更短的语法是

    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'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-13
      • 2010-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-22
      • 1970-01-01
      相关资源
      最近更新 更多