with a as (
select
geom,
population,
zipcode
from
nyc_zips
limit
5
)
select
string_agg(zipcode, ',') as zips,
sum(population) as total_pop,
st_collect(geom)
from
a
create or replace function BuildPoint(x numeric, y numeric, srid int)
returns geometry
language plpgsql
as $$
begin
return st_setsrid(st_makepoint(x, y), srid);
end;
$$;