Home › Forums › kdb+ › Sort a Table › Re: Sort a Table
-
For normal sorting operations see:
q)tab:([] sym:`a`b`c`d`e; x:5?10) q)tab sym x ----- a 8 b 1 c 9 d 5 e 4 q)`sym xdesc tab sym x ----- e 4 d 5 c 9 b 1 a 8
For your request perhaps rotate is what you are looking for
q)2 rotate tab sym x ----- c 9 d 5 e 4 a 8 b 1