Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SELECT     ------- Get all the records from the instance__t table; left join the results of the first query that got the array elements
    instance__t.id,
    instance__t.hrid,
    instance__t.title,
    string_agg (distinct recs.contributors,' | ') as contributors_aggregated,
    string_agg (distinct recs.languages,' | ') as languages_aggregated,
    string_agg (distinct recs.subjects,' | ') as subjects_aggregated 

from FROM folio_inventory.instance__t 
    left join LEFT JOIN recs
    on ON instance__t.id = recs.id
    
group by GROUP BY 
    instance__t.id,
    instance__t.hrid,
    instance__t.title
;

...