I have written a query that will create a table and perform a GROUP BY from an existing spatial table, but the table does have the geometry. I am wondering where, and what, in this query I put to make the new table have spatial geometry (points).
Thanks...
SELECT st_id, name, COUNT(st_id)
INTO climate.test_stats
FROM climate.lugdc_stations
GROUP BY st_id, name
ORDER BY count DESC;
ALTER TABLE climate.test_stats
ADD COLUMN pk_id serial PRIMARY KEY;