RE: help with aggregation query across a second text array column

2018-11-12 Thread Scot Kreienkamp
t.kreienk...@la-z-boy.com > -Original Message- > From: Rob Nikander [mailto:rob.nikan...@gmail.com] > Sent: Monday, November 12, 2018 10:30 AM > To: Postgres General > Cc: Scot Kreienkamp > Subject: Re: help with aggregation query across a second text array column

Re: help with aggregation query across a second text array column

2018-11-12 Thread Rob Nikander
> On Nov 12, 2018, at 9:40 AM, Scot Kreienkamp > wrote: > … I’m not too confident in my answer here (there could be a better way), but this might help. You could use the `unnest` function to transform the array into multiple rows. For example, given a table like create table t1 (env t

help with aggregation query across a second text array column

2018-11-12 Thread Scot Kreienkamp
Hi everyone, I had a dataset like so: Servername|Primary class -- Server1| retail Server2| dmz Server3 | NA And I used this query to summarize it for automated tools: select environment|| ':' || string_agg(name,',') from servers group by environment order by e