I want to aggregate rows using the string aggregate function, however one column is an array.
I have three columns: Employee, Year, Grades. The column Grade is an array. Example:
Row (1) : Employee: Tom | Year: 2019 | Grades: 11,33
Row (2) : Employee: Tom | Year: 2018 | Grades: 45,24,54
'Grade' column is an array. It represents grades for the different tests he took that year
select
Employee,
string_agg (distinct Year, ','),
string_agg (distinct Grades, ',')
from Employee_grades
group by 1
ERROR:
function string_agg(bigint[], unknown) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts.