我知道我可以select by sym, time.second from table
按秒选择或使用xbar
其他一些固定时间间隔
但是它们或多或少是统一的时间间隔。如何在select by中提供完全自定义的时间列表?
您可以使用binr完成此操作
q)tab:([]t:.z.d+10000?.z.n)
q)/ create custom bins ensuring in ascending time order for binr to work correctly
q)tl:.z.d+09:30 10:45 15:32
q)/ x binr y - will return the index of first item in x which is ≥y
q)/ we then index back into our tl with result
q)select count i by tl tl binr t from tab
t | x
-----------------------------| --
2019.03.31D09:30:00.000000000| 6443
2019.03.31D10:45:00.000000000| 807
2019.03.31D15:32:00.000000000| 2750
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句