*** This version of Confluence is for testing only and contains a copy of content from June 29th 2026. No changes will be preserved. ***
...
WITH lc as
(SELECT DISTINCT
sm.instance_hrid,
sm.field,
sm.sf,
sm.content
FROM srs_marctab sm
WHERE sm.instance_hrid between '6403921' and '6404000'
AND sm.field like '6%%'
AND sm.sf in ('a','x','y','z')
AND sm.ind2 = '0'
AND sm.ord = '1'
ORDER BY
sm.instance.hrid,
sm.sf
)
SELECT
lc.instance_hrid,
lc.field,
lc.sf
string_agg (lc.content, ' -- ') as lc_subject
FROM lc
GROUP BY
lc.instance_hrid,
lc.field
ORDER BY
;
And the results would be:
...