KX Community

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

Home Forums kdb+ In funtional qSQL, what is the meaning when the operator is a list? Re: In funtional qSQL, what is the meaning when the operator is a list?

  • gyorokpeter-kx

    Member
    October 11, 2022 at 12:00 am

    The queries are the functional equivalents of:

    select from t where c3<44 select from t where c3>={y-x}
    [min 15 25 35 45;44] 
    select from t where c3>={y-x}
    [min 35 45;44]

    In the 2nd example, min 15 25 35 45 evaluates to 15, {y-x}[15;44] is 29, and the condition c3>=29 is true for 4 rows.

    In the 3rd example, min 35 45 is 35, {y-x}[35;44] is 9 and all rows satisfy c3>=9.

    In the functional form, (‘;~;<) is just the representation of >=. If you type >= at the console, you can see it comes back as ~<, which is the composition of the operators ~ (not) and < (less than). The functional form includes the ‘ (composition) operator.