0

my data be like :

ROW    DATA
1       OK
1       OK
2       ERROR
2       ERROR

I want merge data group by row

ROW     DATA
1       OK,OK
2       ERROR,ERROR

WHICH function could work out ?

2
  • Are you using a programming language? Commented May 20, 2022 at 3:21
  • i am writing a sql query Commented May 20, 2022 at 3:25

2 Answers 2

1

In Oracle, you can use LISTAGG to query the same:

select ROW_, 
       listagg(DATA_, ',') within group (order by ROW_) as DATAS 
from MYTBL
group by ROW_

Test query in fiddle

Sign up to request clarification or add additional context in comments.

Comments

0

For oracle versions older then 11g Release 2 you can use WMSYS package, function WM_CONCAT()

Select ROW_, 
       WMSYS.WM_CONCAT(DATA_)  
From MYTBL
Group By ROW_

1 Comment

[Code: 904, SQL State: 42000] ORA-00904: "WM_CONCAT": invalid identifier

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.