KX Community

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

Home Forums kdb+ Sort a Table Re: Sort a Table

  • rolf

    Member
    November 15, 2023 at 12:00 am
    q)t:([]sym:`a`b`c`d`e;x:til 5)
    q)t iasc`c`d?t`sym
    sym x
    -----
    c 2
    d 3
    a 0
    b 1
    e 4

    if you want to move the desired records to the top but want to preserve the order of the rest of the table