0

これは私が書いたクエリです:

select d.canonical_name,
       l.locale_id,
       d.domain_id,
       ld.display_name,
       p.canonical_name as Identity_Set
  from locale_domain ld
  join domain d on ld.domain_id = d.domain_id
  join locale l on l.locale_id = ld.locale_id
  join domain_set ds on ds.domain_id = d.domain_id
  join set_property sp on sp.domain_set_id = ds.domain_set_id
  join property p on p.property_id = sp.property_id
 where d.canonical_name = 'Video Games'
   and ds.canonical_name = 'IDENTITY_SET'
   group by l.locale_id,d.canonical_name,
       d.domain_id,
       ld.display_name,p.canonical_name
 order by l.locale_id

これは出力です:

Video Games 0   1794    Games                   Video Game Name
Video Games 0   1794    Games                   Video Game Platform
Video Games 1   1794    Video Games_de_DE   Video Game Name
Video Games 1   1794    Video Games_de_DE   Video Game Platform
Video Games 2   1794    Video Games_en_GB   Video Game Name
Video Games 2   1794    Video Games_en_GB   Video Game Platform

これは私が必要なものです:

Video Games 0   1794    Games                  Video Game Name, Video Game Platform
Video Games 1   1794    Video Games_de_DE      Video Game Name, Video Game Platform
Video Games 2   1794    Video Games_en_GB      Video Game Name, Video Game Platform

ご覧のとおり、私はそれを区別する必要があり、コンマで区切られたIDセットの結果が必要です

ありがとう

4

1 に答える 1

0

listagg()これは、Oracle 11 の関数で行うことができます。

with t as (<your query here>)
select cannonical_name, domain_id, ld.display_name,
       listagg(identity_set, ',') within group (order by locale_id)
from t
group by cannonical_name, domain_id, ld.display_name
于 2013-05-07T13:14:17.760 に答える