Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Combination of LISTAGG and DISTINCT with multiple tables join in 12c

User_SPNMXMar 10 2020 — edited Mar 13 2020

Hi,

    Can anyone please suggest to write a query with combination of LISTAGG and DISTINCT with multiple tables join in 12c. I use below query in 11g, but the same query is not working in 12c due to deprecated function WM_CONCAT. Could you please provide any alternate solution for this query in 12c

select a.PS_NETWORK_ID,

           c.name,

           c.mcc,

           WM_CONCAT(distinct d.tc_mnc) AS MNC,

           WM_CONCAT(distinct d.TC_TADIG_CODE) AS TADIG,

           a.PS_DNISNAME,

           b.DMUD_FROM_VALUE,

           b.DMUD_TO_VALUE

from

           srs_pool_selection a,

           sds_dnis_mapping_ui_data b,

           irdb_networklist c,

           IRDB_TADIG_CODES d

where  a.PS_DNISNAME=b.DMUD_DNISNAME

and    a.ps_network_id=c.networkid

and    c.networkid=d.TC_NETWORK_ID

and    c.MCC||MNC=d.TC_MCC||d.TC_MNC

group by a.PS_NETWORK_ID,c.name, c.mcc,a.PS_DNISNAME,b.DMUD_FROM_VALUE,b.DMUD_TO_VALUE

order by c.name;

Thanks & Regards,

Vikas

This post has been answered by odie_63 on Mar 11 2020
Jump to Answer
Comments
Post Details
Added on Mar 10 2020
12 comments
5,119 views