0

Lets say, I have following table(i.e: Reference Table). I want to display my results as 'Expected Table'. How may I get this result? Any help will be highly appreciated. I am using Oracle 10g. Reference Table

Expected:

Expected Table

Nizam Uddin Sikder
  • 495
  • 1
  • 4
  • 9
  • Google "string aggregation Oracle 10g". For example: https://oracle-base.com/articles/misc/string-aggregation-techniques#row_number –  Sep 21 '16 at 18:21

1 Answers1

1
SELECT Collateral_Id,
       LISTAGG(Commitment_Id, ',')
           WITHIN GROUP (ORDER BY Commitment_Id) "Commitment_Id"
FROM yourTable
GROUP BY Collateral_Id
Tim Biegeleisen
  • 502,043
  • 27
  • 286
  • 360
  • Hey! Thanks. But, Oracle 10G does not support LISTAGG. Do you have another option? – Nizam Uddin Sikder Sep 21 '16 at 17:01
  • No wonder Tim gave you an 11g answer... you say 10G in your title, but you TAGGED it as 11g. Most people (Tim, probably, among them) filter the questions they look at by tag, so the tag must be accurate. I will go in and change it now. –  Sep 21 '16 at 18:23
  • I apologize but, I tagged it as 10g. Not 11g. – Nizam Uddin Sikder Sep 21 '16 at 18:35