Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id E9E14634915 for ; Mon, 25 May 2009 10:58:14 -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 37957-04-4 for ; Mon, 25 May 2009 10:58:03 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from jupiter.marktest.pt (delta.marktest.pt [80.251.174.116]) by mail.postgresql.org (Postfix) with ESMTP id D633863583A for ; Mon, 25 May 2009 10:56:01 -0300 (ADT) Received: from suite (suite.marktest.pt [10.61.90.236]) by jupiter.marktest.pt with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id K0H2PV9F; Mon, 25 May 2009 14:55:55 +0100 Message-ID: <025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt> From: "Oliveiros Cristina" To: "Andy Shellam" Cc: References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt> <4A1AA0FA.1070507@networkmail.eu> Subject: Re: Obtaining a limited number of records from a long query Date: Mon, 25 May 2009 14:55:54 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL=0.001 X-Spam-Level: X-Archive-Number: 200905/106 X-Sequence-Number: 32598 Thanks a million, Andy. It's precisely what I needed, Indeed! Best, Oliveiros ----- Original Message ----- From: "Andy Shellam" To: "Oliveiros Cristina" Cc: Sent: Monday, May 25, 2009 2:45 PM Subject: Re: [SQL] Obtaining a limited number of records from a long query > Hi Oliveiros > > Certainly! What you're looking for is the LIMIT...OFFSET syntax. > > Some examples: > > SELECT ... LIMIT 10 - return the first 10 records only. > SELECT ... LIMIT 10 OFFSET 10 - return 10 records, starting with record > 11. > > Manual page: > > http://www.postgresql.org/docs/8.3/interactive/queries-limit.html > > Regards, > Andy > > Oliveiros Cristina wrote: >> Dear List, >> Is there any way to force a query to return just a few records? >> For ex, returning just the first ten rows from a long ORDER BY query ? >> And then, eventually, obtaining the remaining records at a later time, >> or in background? >> Thanks in advance for your help, >> Best, >> Oliveiros > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql >