We have 3 tables with below columns in our current namespace
q)t:([] a:`a`b`c; b:1 2 3);
q)s:([] a:`a`b`c; b:1 2 3);
q)z:([] z:`a`b`c; b:1 2 3);
Now we want to search and print all the tables which have column a.
Expected output: `a`s
I have two ugly solution which somewhat works
q){$[`a in cols x;x;]} each tables[];
q){(enlist x) where enlist(`a in cols x)}each tables[];
But looking for better optimal solution.
It'd be best to use the each right (/:) adverb with in
:
q)tables[] where `a in/: cols each tables[]
`s`t