pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliveiros Cristina <oliveiros.cristina@marktest.pt>
To: Andy Shellam <andy-lists@networkmail.eu>
Cc: pgsql-sql@postgresql.org
Subject: Re: Obtaining a limited number of records from a long query
Date: Mon, 25 May 2009 14:55:54 +0100
Message-ID: <025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt> (raw)
References: <020201c9dd3d$372c3f40$ec5a3d0a@marktestcr.marktest.pt>
	<4A1AA0FA.1070507@networkmail.eu>



Thanks a million, Andy.

It's precisely what I needed, Indeed!

Best,
Oliveiros

----- Original Message ----- 
From: "Andy Shellam" <andy-lists@networkmail.eu>
To: "Oliveiros Cristina" <oliveiros.cristina@marktest.pt>
Cc: <pgsql-sql@postgresql.org>
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
> 




view thread (8+ messages)  latest in thread

Message-ID: <025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt>
Permalink:  ../025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt/
Also on:    postgresql.org/message-id/025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: oliveiros.cristina@marktest.pt, andy-lists@networkmail.eu
  Subject: Re: Obtaining a limited number of records from a long query
  In-Reply-To: <025501c9dd40$86155440$ec5a3d0a@marktestcr.marktest.pt>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox