KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Concatenation issue for atomic values Re: Concatenation issue for atomic values

  • rocuinneagain

    Member
    October 6, 2021 at 12:00 am

    All of these items are equivalent:

     

    q)"10" 
    "10" 
    
    q)("1";"0") "10"
    q)("10") "10"

     

    They all resolve to 2 item lists containing characters

    https://code.kx.com/q/basics/datatypes/

    Here are some more example queries which may help:

     

    q)select from t where Vals in `$/:("1";"10") 
    Vals 
    ---- 
    1 10 
    
    
    q)select from t where Vals in `$/:("1";"0") Vals ---- 1 0
    q)select from t where Vals in `$"10" Vals ---- 10
    q)select from t where Vals in `$"1" Vals ---- 1

     

    You can use ‘=’ rather than ‘in’ if you are searching for only one value:

    q)select from t where Vals=`$"1" 
    Vals 
    ---- 
    1

    You can input your symbols directly rather than casting:

    q)`0`1`10 `0`1`10