bringing data from vertical to horizontal after join
Dear Experts,
I have to join 2 tables outbound and inbound bringing matches from vertical to horizontal
Inbound is grouped by column inbound.key
Inbound.key is joined to outbound.key.
Table inbound = original state
Table outbound = original state
Table inbound after join = result state
for key = 10:
outbound.a1 = inbound.a from 1st match in inbound
outbound.b1 = inbound b
outbound.c1 = inbound c
outbound.d1 = inbound d
outbound.e1 = inbound e
outbound.a2 = inbound.a from 2nd match in inbound
outbound.b2 = inbound b
outbound.c2 = inbound c
outbound.d2 = inbound d
outbound.e2 = inbound e
outbound.a3 = inbound.a from 3rd match in inbound
outbound.b3 = inbound b
outbound.c3 = inbound c
outbound.d3 = inbound d
outbound.e3 = inbound e
for key = 20:
outbound.a1 = inbound.a from 1st match in inbound
outbound.b1 = inbound b
outbound.c1 = inbound c
outbound.d1 = inbound d
outbound.e1 = inbound e
outbound.a2 = inbound.a from 2nd match in inbound
outbound.b2 = inbound b
outbound.c2 = inbound c
outbound.d2 = inbound d
outbound.e2 = inbound e
Remark: There can be up to 10 rows for the same key in table inbound.
How to realize Table outbound after join?
Any idea highly appreciated.
Thanks for help!
BR,
Heinz