general design pattern for smushing rows into one column
0
votes
1
answer
378
views
I have a table of people :
id, person_name
I have a table of tags:
id, tag_name
there is a junction table for the tags that connects people and tags:
id, person_id, tag_id
I have a query to get a group of people based on different search criteria so it's being built up dynamically and what I would like to do is within that query - for each person - I'd like to be able to grab all of the tag names associated w/ that person. I'd like to grab all the associated tags and stick them into one column for each person row (preferably as an array or object). What is the general pattern to be able to return a group of stuff as one column when cycling through rows like this. I'm having trouble figuring out what to search for to find a generalized answer online. I'm using postgres.
Asked by thesofaking
(27 rep)
May 6, 2021, 05:43 PM
Last activity: May 6, 2021, 06:49 PM
Last activity: May 6, 2021, 06:49 PM