[postgis-users] SUM() for lines

Paragon Corporation lr at pcorp.us
Wed Aug 26 15:38:57 PDT 2009


Are you trying to do a rolling sum where each rows sum is the sum of
previous rows in that group.  Its much easier to do in PostgreSQL 8.4

The below article might help
http://www.postgresonline.com/journal/index.php?/archives/119-Running-totals
-and-sums-using-PostgreSQL-8.4-Windowing-functions.html

Leo 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Daniel
Grum
Sent: Wednesday, August 26, 2009 12:20 PM
To: PostGIS Mailing-List
Subject: [postgis-users] SUM() for lines

Hi all,

how can I sum the atributes of any lines of one column --> how I can sum the
info of a column.
I want to save all avaible resources(all polygons) in an extra column next
to the resources of one polygon?!

like this:
gid(integer) | flaeche(double precision) | sum_flaeche(double precision)
   1                            
2000                                      2000
   2                            
5000                                      7000
   3                             
100                                       7100

And how I can select the last info of the column: sum_flaeche to wok with
the number-->in this case: 7100

If this could not work please describe me another possible way?!

--daniel
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users






More information about the postgis-users mailing list