limit in PostgreSQL

Jason FU tsfu at HKUCS.ORG
Fri Aug 12 00:15:54 EDT 2005


It works. Thanks!

But I've got one more question. Limit and offset work within the subquery.
Then how about a union for the subqueries? And what do we do for the very
long subquery? Could we use \ in Oracle or...?

Thanks.

Jason

On Thu, 11 Aug 2005 22:56:56 -0400, Stephen Woodbridge
<woodbri at SWOODBRIDGE.COM> wrote:

>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