pikachuchameleon
pikachuchameleon

Reputation: 675

Multiple union joins in kdb

I have a task in which I need to do Union Joins of variable no. of tables. As of now, I've stored all the tables in a list.

How can I do a multiple union joins of all the tables using adverb ?

Example:

L:(table1,table2,table3)
// I need something like (2!table1) uj (2!table2) uj (2!table3)

Upvotes: 1

Views: 1424

Answers (1)

WooiKent Lee
WooiKent Lee

Reputation: 1311

I think this is already answered here:

How to join multiple tables

q)a:([]a:1 2;b:3 4)
q)b:([]a:1 2;c:5 6)
q)(uj/)1!'(a;b)
a| b c
-| ---
1| 3 5
2| 4 6

Upvotes: 1

Related Questions