Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to concatenate values based on multiple columns duplicate data in the Loop

Rajesh123Aug 3 2015 — edited Aug 3 2015

Hi all,

select '100' col_1 ,'111111' col2  from dual

union all

select '100' col_1 ,'222222' col2  from dual

union all

select '101' col_1 ,'333333' col2  from dual

union all

select '102' col_1 ,'333333' col2  from dual

i need to write using for loop cursor (parameterized) so then , need to concatenate col_1 or col_2

if,

In the table

col_1   col_2

100     111111

100     222222

101     333333

102     333333

Then

col_1      col_2

100          111111,222222

101,102     333333

Is there any way to compare and concatenate values in the Loop

I have more than 4000 bytes in the Table of col_1   ,col_2 data values

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

This post has been answered by RogerT on Aug 3 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2015
Added on Aug 3 2015
15 comments
407 views