On Mon, Jun 30, 2008 at 8:51 AM, Sam Mason <[EMAIL PROTECTED]> wrote:
>>
>> select * from foo where (o,pk)>(o,?) order by o limit 10;
>
> Hum, I think I must be missing something. I'm not sure why you're
> comparing 'o' to itself and you're not putting any ordering constraint
> on the primary key
On Fri, Jun 27, 2008 at 08:22:35PM +, Ragnar wrote:
> let us assume your resultset has a a unique column pk, and is ordered on
> column o:
>
> next page
> select * from foo where (o,pk)>(o,?) order by o limit 10;
> (where the ? is the last pk value in previous select)
>
> this method will b
Bill Thoen wrote:
What I'm wondering is how in PostgreSQL do you select only the first 10
records from a selection, then the next 10, then the next, and possibly
go back to a previous 10?
LIMIT with OFFSET has already been mentioned. There's another option if
your web app is backed by an app
On Fri, Jun 27, 2008 at 2:09 PM, Bill Thoen <[EMAIL PROTECTED]> wrote:
> Thanks for tip on OFFSET. That's just what I needed. It's so easy when you
> know the command you're looking for, and so hard when you know what you want
> to do but don't know what the command is called!
I would strongly sug
Thanks for tip on OFFSET. That's just what I needed. It's so easy when
you know the command you're looking for, and so hard when you know what
you want to do but don't know what the command is called!
Thanks,
- Bill Thoen
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To
Hello
apart from the increasing OFFSET method, you only need to
traverse the results sequentially, you can do a variant of
this:
let us assume your resultset has a a unique column pk, and is ordered on
column o:
initial select:
select * from foo order by o limit 10;
next page
select * from
On 6/27/08, Bill Thoen <[EMAIL PROTECTED]> wrote:
>
> What I want to do is present the results of a query in a web page, but only
> 10 rows at a time. My PostgreSQL table has millions of records and if I
> don't add a LIMIT 10 to the SQL selection, the request can take too long.
> The worst case sc
use a dynamic select in the web page
$1 = 10
$2 = 5
select * from mytable limit $1 OFFSET $2
--- On Fri, 6/27/08, Bill Thoen <[EMAIL PROTECTED]> wrote:
From: Bill Thoen <[EMAIL PROTECTED]>
Subject: [GENERAL] Advice Wanted on Selecting Multi-row Data Requests in 10-Row
Blocks
To: p
>
> What I want to do is present the results of a query in a web page, but
> only 10 rows at a time. My PostgreSQL table has millions of records and
> if I don't add a LIMIT 10 to the SQL selection, the request can take
> too
> long. The worst case scenario is when the user requests all records
>
What I want to do is present the results of a query in a web page, but
only 10 rows at a time. My PostgreSQL table has millions of records and
if I don't add a LIMIT 10 to the SQL selection, the request can take too
long. The worst case scenario is when the user requests all records
without add
10 matches
Mail list logo