Oracle concatente column for different rows

I have the following data and want to concatenate the last column  (4) where the first three are the same. Note column 3 indicates if its part 0 or part 1 so that could be used to indicate that if its a 1 it belongs to the previous row

Columns
1                                      2                              3      4
VAG_AB,      interaction,      gadget-statistics      ,0,      CCStat-CallInQueue_Chat_AB,
VAG_AB,      interaction,      kpi.displayed-kpis      ,0,      KPI-InboundChat,KPI-TransferredChat,KPI-TalkTime_Chat,KPI-Log
VAG_AB,      interaction,      kpi.displayed-kpis      ,1,      inTime_Twitter,KPI-NotReadyTime_Facebook
pcombAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MikeOM_DBACommented:
In Oracle try something like this:
SELECT C1
     , C2
     , C3
     , LISTAGG ( C4, ', ' ) WITHIN GROUP (ORDER BY C4) AS C4list
  FROM Mytable
GROUP BY C1, C2, C3

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
sdstuberCommented:
what should the final output look like?
0
pcombAuthor Commented:
sdstuber - I am trying to do it in Oracle but ideally it would be portable to SQL Server also but not critical
0
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

sdstuberCommented:
ok, what versions of each platform?

and...

what should the final output look like?
0
pcombAuthor Commented:
sdstuber sorry shuold have included that
Columns
1                                      2                              3      4
VAG_AB,      interaction,      gadget-statistics      ,0,      CCStat-CallInQueue_Chat_AB,
VAG_AB,      interaction,      kpi.displayed-kpis      ,0,      KPI-InboundChat,KPI-TransferredChat,KPI-TalkTime_Chat,KPI-Log, inTime_Twitter,KPI-NotReadyTime_Facebook
0
pcombAuthor Commented:
worked great thank you
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.