如何在kdb中查询一个字段中的多个符号?
How do I query multiple symbol in one field in kdb?
如果我只在过滤器中放入一个符号,如何select具体记录?
Eg:
tab:([]a:1 2 3;b:(`abc`bde;`efg`rte;`dqw`gds))
1 (`abc`bde)
2 (`efg`rte)
3 (`dqw`gds)
我想过滤 abc
所以只有 return:
1 (`abc`bde)
select from tab where b=`abc
将不起作用。
您可以将右副词 /:
与 in
函数一起使用:
q)select from tab where `abc in/: b
a b
---------
1 abc bde
这里需要每个权利,因为 table 列是向量;所以 in
正在对 嵌套 符号列表进行操作。下面的 exec
调用更清楚地显示了这一点:
q)0N!(exec b from tab);
(`abc`bde;`efg`rte;`dqw`gds)
如果我只在过滤器中放入一个符号,如何select具体记录?
Eg:
tab:([]a:1 2 3;b:(`abc`bde;`efg`rte;`dqw`gds))
1 (`abc`bde)
2 (`efg`rte)
3 (`dqw`gds)
我想过滤 abc
所以只有 return:
1 (`abc`bde)
select from tab where b=`abc
将不起作用。
您可以将右副词 /:
与 in
函数一起使用:
q)select from tab where `abc in/: b
a b
---------
1 abc bde
这里需要每个权利,因为 table 列是向量;所以 in
正在对 嵌套 符号列表进行操作。下面的 exec
调用更清楚地显示了这一点:
q)0N!(exec b from tab);
(`abc`bde;`efg`rte;`dqw`gds)