Hacker Newsnew | past | comments | ask | show | jobs | submit | thestgman1's commentslogin

Thank you Steam!


KDB is an absolute nightmare, a barbaric piece of tech that should have never existed.

Here is a link on how you do queries: https://code.kx.com/q/basics/funsql/

TL;DR;

This is a select: q)t:([] c1:`a`b`a`c`a`b`c; c2:101+til 7; c3:1.11+til 7)

And this is another select: q)?[t; ((>;`c2;35);(in;`c1;enlist[`b`c])); 0b; ()]

Mind that these are the basic queries :)))))

The future of kdb+ is in the toilet.


The first one is not a select but syntax for defining a small in-memory table named t. You can then do a select on this table. The second is a "functional form" of select i.e. an alternative syntax for select with extended capabilities. It is an advanced feature that is rarely used, but it's there when you need it "for programmatically-generated queries, such as when column names are dynamically produced". Written in the usual syntax this particular expression is the same as "select from t where c2>35,c1 in `b`c".


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: