Search code examples
kdb

q/kdb Selecting a variable in query


q)sym:`a`b`c
q)t:([] s:`g`v; p:2?10.)

Selecting the variable sym works fine in the following query :

q)select sym from t

However it throws an error while selecting with a table column, I am not able to figure out the reason

q)select sym, p from t

Solution

  • You get a 'length error because the lists sym and p (column from t) are different lengths.

    q)sym:`a`b
    q)select sym,p from t
    sym p
    ------------
    a   3.927524
    b   5.170911
    

    What is the output you are trying to get to with this?