Robert Buckley <robertdbuckley <at> yahoo.com> writes: > > Hi,I have a table containing population statistics.I would like to have an column which automatically updates the rank for each dataset. Would I somehow use a sequence to calculate this, or is there another way to do this?thanks,Rob
Off the top of my head, I would build a trigger that updates the rank on any insert/ update/ delete, and I would use a "window function" [1] to determine the new rankings. A sequence just keeps incrementing dumbly, so it wouldn't be a good calculating thing. [1] http://www.postgresql.org/docs/current/static/tutorial-window.html > > _______________________________________________ > postgis-users mailing list > postgis-users <at> 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