key

From The K Language Wiki
Revision as of 09:08, 29 September 2021 by Razetime (talk | contribs) (add key)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Key
x key t

Key is a primitive which creates a keyed table from a normal table, essentially setting one or more columns given in x as the primary keys of t.

 t: +`a`b`c!(1 2;3 4;5 6)
a b c
- - -
1 3 5
2 4 6
 `a`c key t
a c|b
- -|-
1 5|3
2 6|4