[postgis-users] dissolve attributes in a table (no geometry)

Júlio Almeida julio.augusto.almeida at gmail.com
Wed Mar 16 04:54:08 PDT 2011


Hello,

I have a table with point_id, line_id, and distance (from point to line).
I need to create a new table with the record for the shortest distance for
each point.
I have tried:

select point_id,
line_id,
min(distance)
from worktemp.distances2streets group by point_id;

but i get the message:

ERROR:  column "distances2streets.line_id" must appear in the GROUP BY
clause or be used in an aggregate function
LINE 2: line_id,
       ^

********** Erro **********

ERROR: column "distances2streets.line_id" must appear in the GROUP BY clause
or be used in an aggregate function
Estado de SQL:42803
Carácter:18


Any suggestion?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110316/d1430ec8/attachment.html>


More information about the postgis-users mailing list