cancel
Showing results for 
Search instead for 
Did you mean: 

by...where

effbiae
New Contributor
i need to find groups of a where b contains 8 9

q)show t:([]a:3 3 3 4 4;b:7 7 8 8 9)
a b
---
3 7
3 7
3 8
4 8
4 9

i can do this in q
q)where all each 8 9 in/:(t.b group t.a)
,4

can i solve the same in sql something like
q)select by a where all b in 8 9 ... ?

many thanks,
jack
1 REPLY 1

Flying
New Contributor III
This exactly where fby come handy.

q)select from t where({all 8 9 in x};b)fby a
a b
---
4 8
4 9