0

For a where clause to filter on symbol columns, = works fine, but why does the match operator ~ not work?

q)t:([sym:`aa`bb]qty:20 30)

q)t
sym| qty
---| ---
aa | 20
bb | 30

q)select from t where sym=`aa
sym| qty
---| ---
aa | 20

q)select from t where sym~`aa
sym| qty
---| ---
kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80

1 Answers1

4

Match is comparing `aa to the entire symbol column, where equals is comparing to each element

q)`a=`a`b`c
100b
q)`a~`a`b`c
0b

You could do

q)select from t where sym~\:`aa
sym| qty
---| ---
aa | 20
Adam Bonham
  • 615
  • 4
  • 7