0

I am trying to use Array_agg to help combine some records, but it seems to be removing the record when I try to use it. The format of what I have written is below. All the records which are individual stay.

SELECT 
columnA,
columnB,
columnC,
string.Join(", ", ARRAY_AGG(column1)) AS col1,
string.Join(", ", ARRAY_AGG(column2)) AS col2,
SUM(column3) AS col3,
SUM(column4) AS col4,
FROM table
GROUP BY columnA, columnB,columnC
Big_D
  • 15
  • 3
  • Please add more info to your question. You mean you lost column1 and columns2 when you use your function? How you output this data? – Kiril1512 Aug 21 '19 at 15:30
  • Out putting as a CVSs. Within the data set there were two records which I wanted to combine because of column 1 and 2. However in the output they do not appear at all, combined or not! – Big_D Aug 22 '19 at 17:07
  • can you show the example? – Jorge Ribeiro Sep 05 '19 at 11:03

0 Answers0