Re: how to handle Pagination >

From: jesusthefrog <jesusthefrog(at)gmail(dot)com>
To: Madhavan <vbtamil(at)zoho(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: how to handle Pagination >
Date: 2013-10-15 15:01:33
Message-ID: CAH_wARvFGFxoxdnXc5FP=qeZuAh+Azi_yGs1VG0NabGXc+Picw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

You will probably want to use OFFSET and LIMIT, which are the window size
and page. Something like

SELECT .. FROM ... WHERE ... ORDER BY (...) OFFSET y LIMIT x

So say you want to get 100 records at a time. You would get page 1 with
OFFSET 0 LIMIT 100, then page 2 with OFFSET 100, OFFSET 200, and so on.

That's just off the top of my head. There may be another solution which
will work better in your case, but lacking details, this is what I would
recommend.

--
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d+ s: a-- C++++(++) UL+++ P++++$ L+++>++++ E- W+ N o? K w--- O-
M- V? PS+++ PE(-) Y+ PGP->+++ t+>++ 5+++++ X(+) R>+ tv b+
DI++ D++>+++ G+ e* h! !r y**
------END GEEK CODE BLOCK------

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Vik Fearing 2013-10-15 16:54:43 Re: how to handle Pagination >
Previous Message Madhavan 2013-10-15 14:52:18 how to handle Pagination >