Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can one drop/delete columns from a KDB table in place?

Tags:

kdb

Following the documentation, I tried to do the following:

t:([]a:1 2 3;b:4 5 6;c:`d`e`f) // some input table
`a`b _ t                       // works: delete NOT in place
(enlist `a) _ t                // works: delete NOT in place
t _:`a`b                 // drop columns in place does not work; how to make it to work?
// 'type
//   [0]  t _:`a`b

Thank you very much for your help!

like image 974
S.V Avatar asked Dec 23 '22 15:12

S.V


1 Answers

You should be able to use

delete a,b from `t

to delete in place (The backtick implies in place).

Alternatively, for more flexibility you could use the functional form;

![`t;();0b;`a`b]
like image 79
Michael K Avatar answered Feb 15 '23 02:02

Michael K