LISTAGG alternative in Oracle 10g

后端 未结 4 1913
轻奢々
轻奢々 2020-12-19 12:57

I am kind of newbie in Oracle. Got stuck in the below: I have the below 2 tables:

Site:

**SiteID|SiteName** 
1      Sydney
2      Ne         


        
4条回答
  •  死守一世寂寞
    2020-12-19 13:35

    I just needed an alternative for listagg on oracle 10g and found one in this page https://oracle-base.com/articles/misc/string-aggregation-techniques.

    just use wm_concat, albeit it is not supported by oracle and has been droped in 12c.

    with the example above:

    select
        p.PeopleID,wm_concat(s.SiteName)
    from people p
    join site s on p.SiteID = s.SiteID
    group by p.PeopleID;
    

提交回复
热议问题