【问题标题】:Can I select the data in the window obtained by the function interval?可以选择函数区间得到的窗口中的数据吗?
【发布时间】:2021-10-21 15:22:58
【问题描述】:

我们使用语句“group by symbol, interval(time, 1000605, "null")”来获取5分钟的数据统计,但是结果表中的interval_time是窗口的开始时间。可以用结束窗口时间作为interval_time吗?

【问题讨论】:

    标签: sql dolphindb


    【解决方案1】:

    以下是示例代码:

    t=table((2018.01.01T01:00:00+rand(1000,25)) join (2018.01.01T02:00:00 + rand(100,5)) as time, rand(1.0, 30) as x)
    select temporalAdd(t.intervaltime,5,"m"),last_x from (select last(x) from t group by interval(time, 300, 1) as intervaltime) as t
    

    【讨论】:

      猜你喜欢
      • 2021-03-07
      • 2010-12-18
      • 2019-08-24
      • 2019-10-03
      • 2020-05-26
      • 1970-01-01
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多