I have a Input Table of this structure
Input :
Col1 | Col2 | Col3
O1 | P1 | 100
O1 | P2 | 200
O1 | P3 | 300
O2 | P1 | 100
O2 | P2 | 200
I need to find the Different Combinations and aggregate the Values in another Column at the same time.
Output Expected :
Col1 | Col2 | COl3
O1 | P1,P2 | 300
O1 | P2,P3 | 500
O1 | P3,P1 | 400
O1 | P1,P2,P3 |600
O2 | P1,P2 | 300
Need some help in how to approach this Problem and Where to start.
string_aggwould have been a simple solution. Have a look at postgresql.org/docs/devel/static/functions-aggregate.html