hello q gods,
let’s say I have two tables
d:( sym:a
ab
c;c1:1 2 3 4;c2:4#0N;c3:0N 10 20 30);
l:([sym:a
b]c2:500 600;c3:1000 2000);
q)
q)d
sym c1 c2 c3
------------
a 1
a 2 10
b 3 20
c 4 30
q)
q)
q)l
sym| c2 c3
—| --------
a | 500 1000
b | 600 2000
I want to perform a special left join between these two tables so that instead of the right table overwriting all entries on the left table, it only overwrites if the corresponding entry in the left table is null.
so my expected result is this:
sym c1 c2 c3
---------------
a 1 500 1000
a 2 500 10
b 3 600 20
c 4 30
Not this:
q)d lj l
sym c1 c2 c3
---------------
a 1 500 1000
a 2 500 1000
b 3 600 2000
c 4 30
I can do this using cols[d]xcols 0!((select sym from d)#l)^d
but I strongly believe that a more elegant solution exists and would like to be enlightened..
thank you!