Iterate over current row values in kdb query

纵饮孤独 提交于 2019-12-12 02:39:13

问题


Consider the table:

q)trade
stock price amt  time
-----------------------------
ibm   121.3 1000 09:03:06.000
bac   5.76  500  09:03:23.000
usb   8.19  800  09:04:01.000

and the list:

q)x: 10000 20000

The following query:

q)select from trade where price < x[first where (x - price) > 100f]
'length

fails as above. How can I pass the current row value of price in each iteration of the search query?

While price[0] in the square brackets above works, that's obviously not what I want. I even tried price[i] but that gives the same error.

来源:https://stackoverflow.com/questions/33386027/iterate-over-current-row-values-in-kdb-query

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!