I am just writing small part of stored procedure, Consider following as StoredProc
mainQuery CLOB := 'select name, no from main_table od ';
subQuery CLOB := 'select LISTAGG(address, '||''','''||') within group (ORDER BY address) from sub_table sb where sb.id = od.id';
Here, I want output of subQuery clob in mainQuery clob as a column with sub as alias name. I very newbie to plsql.