Sorry I had a typo - try the below instead: SELECT Max(f.gid) as newgid, f.name, ST_MakePolygon(ST_MakeLine(f.the_geom)) As newgeom FROM (SELECT name, 0 as psort, gid, the_geom FROM foll UNION ALL SELECT fs.* FROM (SELECT DISTINCT ON(name) name, 1 As psort, gid , the_geom FROM foll ORDER BY name, gid) fs ORDER BY 1,2,3) As f WHERE f.name = 'abc' GROUP BY f.name
Hope that helps, Regina -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of S.Reena Sent: Wednesday, July 02, 2008 1:42 AM To: postgis-users@postgis.refractions.net Subject: RE: [postgis-users] makepolygon with geom info I tried that but its givin the error as f.gid doesnt exist....in the 2nd query..while the first query was fine ..it just said that lwshell doesnt exist..as the start n end points r different...... -- View this message in context: http://www.nabble.com/makepolygon-with-geom-info-tp18214128p18230652.html Sent from the PostGIS - User mailing list archive at Nabble.com. _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users