gpt4 book ai didi

kdb - 根据字符数组列的值进行选择 - KDB

转载 作者:行者123 更新时间:2023-12-05 00:29:03 28 4
gpt4 key购买 nike

我有一个像这样构建的表:

tab: ([]col1:();col2:())
`tab insert (`testsym; "testchararr")

我现在想选择 col2 所在的行具有值 "testchararr" .我试过这样:
select from tab where col2 = "test"

但这总是返回 'length错误。

如何根据字符数组的值进行查询?谢谢

最佳答案

使用“喜欢”或副词。例如

q)select from tab where col2 like "testchararr"
col1 col2
---------------------
testsym "testchararr"

q)select from tab where col2~\:"testchararr"
col1 col2
---------------------
testsym "testchararr"

q)select from tab where col2 like "test"
col1 col2
---------

q)select from tab where col2~\:"test"
col1 col2
---------

我建议检查每种方法的速度。有关使用中的 qsql 的更多示例,请参阅:
http://www.timestored.com/b/forums/topic/string-functions-like-search-replace-regex/

关于kdb - 根据字符数组列的值进行选择 - KDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17878781/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com