For sample data as below,
Col1 Col2
1 A
1 B
1 C
2 A
2 B
the output I am looking for is
COL1 COL2
1 A B C
2 A B
This can be done using LISTAGG on Oracle or recursive queries on other DBs but Redshift doesnt support both.
How do I achieve this on Redshift
They just added LISTAGG()
to Redshift (2015-07-31). http://docs.aws.amazon.com/redshift/latest/dg/r_LISTAGG.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With