kdb - 如何在 KDB 中按月选择?
问题描述
我有一张表格
t r v
-------------------------------------------------
2016.01.04D09:51:00.000000000 -0.01507338 576
2016.01.04D09:52:00.000000000 -0.001831502 200
2016.01.04D11:37:00.000000000 -0.001100514 583
2016.01.04D12:04:00.000000000 -0.001653045 1000
我想获得 2020 年 10 月的值。
我试着做一个查询:
select from x where t.month = 2020.10
但这没有用。我想我可能需要转换日期类型?我究竟做错了什么?
解决方案
尾随m
允许解释器知道原子是月份类型而不是浮点类型。
q)type 2020.10
-9h
q)type 2020.10m
-13h
q)select from x where t.month=2020.10
t
-
q)select from x where t.month=2020.10m
t
-----------------------------
2020.10.20D20:20:00.000000000
推荐阅读
- django - 请求-回复周期结束时是否会收集请求数据垃圾?
- php - 正则表达式未按预期工作(据我所知)
- python - SQLalechemy 查询返回对象而不是值
- android-studio - 从 AndroidStudio 和 gradle 任务运行测试的区别
- php - Doctrine - 父子查询结果关系
- html - 如何在其中集中元素
所以,我有这个代码
<div id="timer"> </div>
如何将其集中在 HTML5 中?我试过了,但据我所知,它对于 HTML5 来说已经过时了,我必须使用 CSS 有什么帮助吗?
- c# - 如何使服务应用程序每年在特定日期运行一次?
- jenkins - 如何在同一台机器但不同的端口上安装 Jenkins?
- docker - HelloWorld Apama Docker 应用程序
- javascript - 使用 react-redux 为一个简单的动作创建者返回一个承诺