pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrei Bintintan <klodoma@ar-sd.net>
To: Andreas <maps.on@gmx.net>
To: pgsql-sql@postgresql.org
Subject: Re: where to start with this procedure ?
Date: Thu, 20 May 2004 10:17:18 +0300
Message-ID: <00bb01c43e3a$7d33f980$0b00a8c0@forge> (raw)
References: <40ABFCDE.8020601@gmx.net>

Hi,

Use the Offset and Limit in the SQL query.

http://developer.postgresql.org/docs/postgres/queries-limit.html

For example:

SELECT select_list
    FROM table_expression
    WHERE condition
Let's supose that this query returnes normaly 30000 elements.

SELECT select_list
    FROM table_expression
    WHERE condition
    LIMIT 50
    OFFSET 10000

This query will return 50 elements starting with the 10000 elements... so
the elemenst from 10000 to 10050.

Hope that helps.

Best regards,
Andy.

----- Original Message -----
From: "Andreas" <maps.on@gmx.net>
To: <pgsql-sql@postgresql.org>
Sent: Thursday, May 20, 2004 3:33 AM
Subject: [SQL] where to start with this procedure ?


> Hi,
> I know a bit of SQL but not exactly a lot so I ran into this problem.
>
> I have tables on the server that get joined in a view.
> That's OK.
>
> Now I need just a couple of records say 10-100 of 30 000 which could
> easily be filtered by a integer key.
> As of now I have to pull the whole lot into Access and let it do the
> filtering. That doesn't play nice on our network.
>
> Could someone kick me into the right direction where to learn stuff like:
>
> function grabem(x integer) recordset
> (
>    grabem = select * from my_view where key = x
> )
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html
>





view thread (4+ messages)  latest in thread

Message-ID: <00bb01c43e3a$7d33f980$0b00a8c0@forge>
Permalink:  ../00bb01c43e3a$7d33f980$0b00a8c0@forge/
Also on:    postgresql.org/message-id/00bb01c43e3a$7d33f980$0b00a8c0@forge

 · 

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: klodoma@ar-sd.net, maps.on@gmx.net
  Subject: Re: where to start with this procedure ?
  In-Reply-To: <00bb01c43e3a$7d33f980$0b00a8c0@forge>

* 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