Terry
Terry

Reputation: 519

How to I query this table to pick from the symbol list?

I would like to filter out the record that has `1 from the symbol list

Example table:

tab:([]a:((``1`2);`a;b);c:1 2 3);

I tried this:

select from tab where a = `1

also this:

select from tab where `1 in raze a

None of those work.

Upvotes: 1

Views: 725

Answers (2)

Matthew Madill
Matthew Madill

Reputation: 880

If you have the table:

q)tab:([]a:((``1`2);`a;`b);c:1 2 3)
q)tab
a     c
-------
``1`2 1
`a    2
`b    3

You could use the keyword in combined with each right to remove the desired row:

q)select from tab where not `1 in/: a
a c
---
a 2
b 3

Upvotes: 6

Dan Sheppard
Dan Sheppard

Reputation: 106

Hey your tab gives a 'b error so i've swapped b->3

q)tab
a     c
-------
``1`2 1
`a    2
3     3
q)select from tab where max each`1~''a
a    c
------
 1 2 1
q)select from tab where not max each`1~''a
a  c
----
`a 2
3  3

Upvotes: 4

Related Questions