Thank you for pointing it out, Ivan.
The query I am trying to restrict output for happens to be an ORDER BY query.
Actually I wasn't aware of this detail.
I'll leave a mental note for myself that results might be unexpected for not ORDER BY queries

Best,
Oliveiros

----- Original Message ----- From: "Ivan Sergio Borgonovo" <m...@webthatworks.it>
To: <pgsql-sql@postgresql.org>
Sent: Monday, May 25, 2009 3:13 PM
Subject: Re: [SQL] Obtaining a limited number of records from a long query


On Mon, 25 May 2009 14:55:54 +0100
"Oliveiros Cristina" <oliveiros.crist...@marktest.pt> wrote:



Thanks a million, Andy.

It's precisely what I needed, Indeed!

Beware: unless you specify an ORDER BY (and you expect no other
record is inserted between one query and the other... or you just
don't care) you may incur in unexpected results.

A query without an order by is not granted to return the result in
the same order.

If you can (same session) you may use cursors.


--
Ivan Sergio Borgonovo
http://www.webthatworks.it


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

Reply via email to