Postgresql Group By Concatenate Javascript Interview