I have a dept --< emp schema. I want create a resultset which joins dept and emp with a row for each dept and a column which is an array of emps in each dept.
So something like select dept_name, xxxxxxx from dept,emp where emp_dept_id = dept_id
returning
department1 | fred,bill,joe
department2 | faith, hope, charity