Given the following sample table:
C1 C2 C3
=================
A 21 S
A 22 S
A 23 S
A 24 T
B 25 S
B 26 S
How can I write an SQL query to give the following output:
COL1 COL2 COL3
======================
A 21,22,23 S
A 24 T
B 25,26 S
For all rows in the input table where C1 and C3 are the same, I want one row in the output table that has all the C2 values concatenated, comma separated.
I'm working with an Oracle database.