Tuesday, January 25, 2022

**** How to change table rows into column ****

 **** How to change table rows into 1 column  ****


Ex:1

select listagg(aa.name, ',') within group (order by aa.name) from (

SELECT *  

FROM apps.pa_projects_all ppa

where ppa.segment1='15832'

) aa

**** How to change table rows into column  ****

Ex:2

select listagg(aa.name, ',') within group (order by aa.name) from (

SELECT *  

FROM apps.pa_projects_all ppa

where ppa.project_type like '%Admin Support%'

and last_update_date>sysdate-30

) aa

No comments:

Post a Comment