LIMIT + OFFSET

Started by MGabout 20 years ago2 messagesgeneral
Jump to latest
#1MG
pgsql-general@carladata.de

Hello,

I want to show an overview where you can place 16 data sets.
I use the sql-statement
SELECT F1,F2 FROM testtable limit 16 offset 0

To show different pages I vary the value for offset.

But if I want to stay on a special data set, I have the problem to find the right value for offset.
How can I realize this?

Thanks for your help

Michaela

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: MG (#1)
Re: LIMIT + OFFSET

am 17.01.2006, um 16:43:36 +0100 mailte MG folgendes:

Hello,

I want to show an overview where you can place 16 data sets.
I use the sql-statement
SELECT F1,F2 FROM testtable limit 16 offset 0

To show different pages I vary the value for offset.

But if I want to stay on a special data set, I have the problem to find the right value for offset.
How can I realize this?

You shoeld add a 'order by F1, F2' to get e defined order for the
result-set.

HTH, Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===