1
WITH repositories AS (
2
SELECT channelrepository.mgm_id,
3
channelrepository.channel_id,
4
string_agg(((channelrepository.repository_id || ' - '::text) || (channelrepository.repository_label)::text), ';'::text) AS channel_repositories
5
FROM channelrepository
6
GROUP BY channelrepository.mgm_id, channelrepository.channel_id
7
)
8
SELECT channel.mgm_id,
9
channel.organization,
10
channel.channel_id,
11
channel.label,
12
channel.name,
13
channel.summary,
14
channel.description,
15
channel.parent_channel_label,
16
channel.arch,
17
channel.checksum_type,
18
repositories.channel_repositories,
19
channel.synced_date
20
FROM (channel
21
LEFT JOIN repositories ON (((channel.mgm_id = repositories.mgm_id) AND (channel.channel_id = repositories.channel_id))))
22
WHERE (channel.organization IS NOT NULL)
23
ORDER BY channel.mgm_id, channel.organization, channel.channel_id;