kdb+ Q : select from table where column value =

kdb+ Q : select from table where column value =

我如何 select 来自 table 的所有行,其中特定列值等于某个值? 我尝试了以下方法:

select from tablname where columnvalue = value

谢谢

你可以这样做:

q)tbl:([] a:1 2 3;b:4 5 6;c:7 8 9)
q)tbl
a b c
-----
1 4 7
2 5 8
3 6 9
q)select a from tbl
a
-
1
2
3

你可以这样做:

q)table:([]a:1 2 3 4 5;b:`a`b`c`d`e;c:`hi`bye`bye`bye`hi)
q)table
a b c
-------
1 a hi
2 b bye
3 c bye
4 d bye
5 e hi
q)select from table where c=`bye
a b c
-------
2 b bye
3 c bye
4 d bye