Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 060E9632D73 for ; Mon, 25 May 2009 11:14:00 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 41884-05 for ; Mon, 25 May 2009 11:13:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp-out25.alice.it (smtp-out25.alice.it [85.33.2.25]) by mail.postgresql.org (Postfix) with ESMTP id 6081F632323 for ; Mon, 25 May 2009 11:13:55 -0300 (ADT) Received: from FBCMMO02.fbc.local ([192.168.68.196]) by smtp-out25.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Mon, 25 May 2009 16:13:52 +0200 Received: from FBCMCL01B01.fbc.local ([192.168.69.82]) by FBCMMO02.fbc.local with Microsoft SMTPSVC(6.0.3790.1830); Mon, 25 May 2009 16:13:52 +0200 Received: from kerberos.webthatworks.it ([82.50.69.203]) by FBCMCL01B01.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Mon, 25 May 2009 16:13:23 +0200 Received: from dawn.webthatworks.it (dawn.webthatworks.it [192.168.1.12]) by kerberos.webthatworks.it (Postfix) with ESMTP id DB4CCE6AE7 for ; Mon, 25 May 2009 16:13:49 +0200 (CEST) Received: from dawn.webthatworks.it (localhost [127.0.0.1]) by dawn.webthatworks.it (Postfix) with ESMTP id 823873DB19 for ; Mon, 25 May 2009 16:13:48 +0200 (CEST) Date: Mon, 25 May 2009 16:13:47 +0200 From: Ivan Sergio Borgonovo To: Subject: Re: Obtaining a limited number of records from a long query Message-ID: <20090525161347.166789ac@dawn.webthatworks.it> In-Reply-To: <025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt> References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt> <4A1AA0FA.1070507@networkmail.eu> <025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt> Organization: http://www.webthatworks.it X-Mailer: Claws Mail 3.7.1 (GTK+ 2.16.1; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 May 2009 14:13:24.0287 (UTC) FILETIME=[F74564F0:01C9DD42] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/107 X-Sequence-Number: 32599 On Mon, 25 May 2009 14:55:54 +0100 "Oliveiros Cristina" 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