X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2744BD1B17B for ; Thu, 20 May 2004 04:17:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 17019-10 for ; Thu, 20 May 2004 04:17:08 -0300 (ADT) Received: from ar-sd.net (unknown [81.196.32.112]) by svr1.postgresql.org (Postfix) with ESMTP id 5C648D1B18F for ; Thu, 20 May 2004 04:17:06 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by ar-sd.net (Postfix) with ESMTP id 650981F673; Thu, 20 May 2004 10:17:46 +0300 (EEST) Received: from forge (unknown [192.168.0.11]) by ar-sd.net (Postfix) with SMTP id 442BF176C4; Thu, 20 May 2004 10:17:46 +0300 (EEST) Message-ID: <00bb01c43e3a$7d33f980$0b00a8c0@forge> From: "Andrei Bintintan" To: "Andreas" , References: <40ABFCDE.8020601@gmx.net> Subject: Re: where to start with this procedure ? Date: Thu, 20 May 2004 10:17:18 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2739.300 X-Virus-Scanned: by AMaViS snapshot-20020531 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200405/175 X-Sequence-Number: 17889 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" To: 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 >