Search code examples
kdb

kdb: getting one row from HDB


For a normal table, we can select one row using select[1] from t. How can I do this for HDB?


I tried select[1] from t where date=2021.02.25 but it gives error

Not yet implemented: it probably makes sense, but it’s not defined nor implemented, and needs more thinking about as the language evolves


Solution

  • select[n] syntax works only if table is already loaded in memory. The easiest way to get 1st row of HDB table is:

    1#select from t where date=2021.02.25
    

    select[n] will work if applied on already loaded data, e.g.

    select[1] from select from t where date=2021.02.25