pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Huxton <dev@archonet.com>
To: rajesh <rajesh.prabhu@lycos.com>
To: pgsql-sql@postgresql.org
Subject: Re: "Display of specified number of records."
Date: Wed, 11 Jul 2001 10:10:51 +0100
Message-ID: <00e901c109e9$6326c640$1001a8c0@archonet.com> (raw)
References: <f3522ac.0107060247.cad5295@posting.google.com>

From: "rajesh" <rajesh.prabhu@lycos.com>

> Hi,
>   I have got following simple SQL.
>   Select TestID from test where testname = ' ' order by testdate.
>
>   Suppose for argument sake there are 100 records and testID's are 1
> to 100.
>   Is it possible to modify this SQL so that it will display records
> from 10 to 50 and not any other records.

Robby Slaughter has given one solution in another reply.

If that's not quite what you're after, and you want the 10th to 50th results
from the above query you can do:

... order by testdate limit 40 offset 10;

This calculates the results and then throws away the first nine and anything
after the 50th.

- Richard Huxton




view thread (4+ messages)

Message-ID: <00e901c109e9$6326c640$1001a8c0@archonet.com>
Permalink:  ../00e901c109e9$6326c640$1001a8c0@archonet.com/
Also on:    postgresql.org/message-id/00e901c109e9$6326c640$1001a8c0@archonet.com

 · 

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: dev@archonet.com, rajesh.prabhu@lycos.com
  Subject: Re: "Display of specified number of records."
  In-Reply-To: <00e901c109e9$6326c640$1001a8c0@archonet.com>

* 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