467,877 Members | 1,199 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,877 developers. It's quick & easy.

Db2 Pivot rows to columns - with two keys

Bit
Hoping someone can help, I am working with a db2 database and I am trying to pivot some data to turn it from rows to columns. My data table looks like this

ID Date Value Key ValueB
One 01/01/2020 Blue Abc
One 01/01/2020 Pink Def
One 02/02/2020 Purple Ghi
Second 01/01/2020 Blue Jkl
Second 01/01/2020 Pink Mno
Iím looking for my output data to look something like this

ID Date Blue Pink Purple
One 01/01/2020 Abc Def
One 02/01/2020 ghi
Second 02/01/2020 Jkl Mno
Thank you in advance. I think case statements might work but not sure how to approach it
3 Weeks Ago #1
  • viewed: 1293
Share:

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by J055 | last post: by
reply views Thread by jack112 | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.