-->

Iterate over current row values in kdb query

2019-09-04 14:57发布

问题:

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.

标签: kdb