1
SELECT DISTINCT systemaction.mgm_id,
2
systemaction.action_id,
3
systemaction.earliest_action,
4
systemaction.event,
5
systemaction.action_name,
6
systemaction.scheduler_id,
7
systemaction.scheduler_username,
8
string_agg((systemaction.hostname)::text, ';'::text) FILTER (WHERE (((systemaction.status)::text = 'Picked Up'::text) OR ((systemaction.status)::text = 'Queued'::text))) OVER (PARTITION BY systemaction.action_id) AS in_progress_systems,
9
string_agg((systemaction.hostname)::text, ';'::text) FILTER (WHERE ((systemaction.status)::text = 'Completed'::text)) OVER (PARTITION BY systemaction.action_id) AS completed_systems,
10
string_agg((systemaction.hostname)::text, ';'::text) FILTER (WHERE ((systemaction.status)::text = 'Failed'::text)) OVER (PARTITION BY systemaction.action_id) AS failed_systems,
11
systemaction.archived,
12
systemaction.synced_date
13
FROM systemaction
14
ORDER BY systemaction.mgm_id, systemaction.action_id;