Say I have a table
tbl:([]a:`XXY`XXZ`XZZ`XYZ)
q)tbl
a
---
XXY
XXZ
XZZ
XYZ
And I want to select the rows like "XX" or "ZZ"
Is there a more compact way than writing
select from tbl where (a like "*XX*")|(a like "*ZZ*")
Ideally I'd like to store all my or options in a variable and then pass that to the select.
I've tried using functional selects, but can only get it to work for a single or and only in the below form.
q)c:(like;`a;enlist "*XX*")
::
q)?[tbl;enlist c;0b;()]
a
---
XXY
XXZ
Instead of setting enlist "XX" within c, could I create a table or list and then pass that into c?
Thank you