Postgresql Group By Concatenate Strings In C