Created
January 7, 2020 05:59
-
-
Save oeon/e79343ed661a76eeb544e4f239059c61 to your computer and use it in GitHub Desktop.
unnested photo array - captions...aggregated back together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select _record_id, string_agg(unnest, ', ') as photos, string_agg(photos_captions, ', ') as photos_captions from (select r._record_id, r.unnest, k.labels as photos_captions from records r join rek k on k.photo = r.unnest order by _record_id) a group by _record_id order by _record_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment