Skip site navigation (1) Skip section navigation (2)

Re: where to start with this procedure ?

From: "Andrei Bintintan" <klodoma(at)ar-sd(dot)net>
To: "Andreas" <maps(dot)on(at)gmx(dot)net>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: where to start with this procedure ?
Date: 2004-05-20 07:17:18
Message-ID: 00bb01c43e3a$7d33f980$0b00a8c0@forge (view raw or flat)
Thread:
Lists: pgsql-sql
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(dot)on(at)gmx(dot)net>
To: <pgsql-sql(at)postgresql(dot)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
>



In response to

Responses

pgsql-sql by date

Next:From: AndreasDate: 2004-05-20 14:46:34
Subject: Re: where to start with this procedure ?
Previous:From: AndreasDate: 2004-05-20 00:33:34
Subject: where to start with this procedure ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group