Let's see the definition of upsert
:
q)upsert
.[;();,;]
So it is just an Amend Entire:
.[d;();v;y] <=> v[d;y]
q).[1 2; (); ,; 3 4 5]
1 2 3 4 5
It looks like join ,
under the hood.
But applying the same approach to adding some rows to a table gives different results:
q)show t:((`a`b!1 2);(`a`b!3 4))
a b
---
1 2
3 4
q).[t;();,;(5 6;7 8)]
a b
---
1 2
3 4
5 6
7 8
q),[t;(5 6;7 8)]
`a`b!1 2
`a`b!3 4
5 6
7 8
For some reason q
doesn’t want to join ,
list of lists to the table in the same way as in Amend Entire. I’m wondering why.
Could you give me some directions please?