limit in PostgreSQL

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Thu Aug 11 22:56:56 EDT 2005


Jason FU wrote:
> In Oracle, we have rowid for limiting the number of selected rows/records.
> In PostgreSQL, we have limit and offset. But how do we use limit in the
> MapServer. For Oracle spatial, we simply add rowid in the FILTER statement.
> What do we do in PostGIS connection?

DATA "the_geom from (SELECT gid, the_geom, ... FROM mytable LIMIT 2000) 
as foo using srid=4326 using unique gid"

so basically you can put any SQL query as a sub-select as long as you 
return at least the_geom and gid or oid, other fields can be used for 
class expressions.

-Steve W
  http://imaptools.com/



More information about the mapserver-users mailing list