I have a query of the form below and I need it to partition by a certain column but when I place it like this, it gives me the error : from keyword not found where expected
Select distinct t_name, rtrim(xmlagg(xml element(e, text, ',').extract('//text()') order by c_id).getclobval(), ',' ) over (partition by t_name) col_list from all_cls where schema ='a' and table in ('tableA' , 'tableB')
What is the issue and how do I fix it so it functions properly with xmlagg as it does have for the below query with list agg :
Select distinct t_name, listagg(text ',' ) within group(order by c_id) over (partition by t_name) col_list from all_cls where schema ='a' and table in ('tableA' , 'tableB')