k1:([a:("ff"; "yy"; "zz");z:("tt"; "yy"; "hh")] b:("33"; "44"; "55"); c:("66"; "77"; "88"))
k2:([z:()] a:(); b:(); c:(); m:(); i:())
k1 and k2 are keyed tables. k2 has all the columns of k1 and more.
How do I perform a conditional upsert from k1 to k2. Basically, what is the corresponding working statement of the one below:
`k2 upsert select k1 where a="ff"
I think this will solve your issue:
k2 uj `z xkey select from k1 where a like "ff"
the xkey will maintain the key on k2 while the uj will maintain all of the columns, including those without values in k1.
In this example this would return:
z | a b c m i
----| ------------------
"tt"| "ff" "33" "66"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With