Skip to content Skip to sidebar Skip to footer

How To Concatenate Text From Multiple Rows Into A Single Text String In Oracle Server?

I have a table with data like this: ID, END_DATE, CLOSE_DATE 1, 2018-05-18, 2018-05-15 2, 2018-05-18, 2018-05-14 3, 2018-05-18, 2018-05-11 4, 2018-05-18, 2018-05-10 I n

Solution 1:

Have you tried this?

select end_date,
       listagg(CLOSE_DATE, ',') within group (order by CLOSE_DATE DESC) as close_dates,
       listagg(id, ',') within group (order by id) as ids
from TBL_S_PLCLOSEDATE
where D_END = date '2018-05-18'
group by end_date;

Post a Comment for "How To Concatenate Text From Multiple Rows Into A Single Text String In Oracle Server?"