hi all,
i am in a situation, want all rows data in single column but after every row it should start from next line as:
desired output:
1st Name
2nd Name
3rd Name
what i tried is as below but its not working:
create table templistagg (v_name varchar2(10));
insert into templistagg values('1st Name');
insert into templistagg values('2nd Name');
insert into templistagg values('3rd Name');
select listagg(v_name, '\n ') within group (order by v_name) as all_names
from templistagg;
-- also tried following: --
select listagg(v_name||chr(13), ', ') within group (order by v_name) as all_names
from templistagg;
select listagg(v_name, '\r ') within group (order by v_name) as all_names
from templistagg;
please help.
regards