Skip to content
Advertisement

Pivot and Sum in Amazon Redshift

I have a following tables

table1

table2

first I’d like to join table2 as follows

and then join table2 with id and pivot and sum up them

I guess it is very complicated, are there any way to achieve this?

In Redshift it seems that there is no way to pivot them.

Thanks.

Advertisement

Answer

This looks to be a pivot query. I think this does what you are looking for:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement