X-Original-To: pgsql-sql@postgresql.org Received: from localhost (developer.postgresql.org [64.117.224.193]) by developer.postgresql.org (Postfix) with ESMTP id F34F4925B11 for ; Fri, 23 May 2003 10:27:45 -0400 (EDT) Received: from developer.postgresql.org ([64.117.224.193]) by localhost (developer.postgresql.org [64.117.224.193:10024]) (amavisd-new) with ESMTP id 07354-05 for ; Fri, 23 May 2003 10:27:43 -0400 (EDT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by developer.postgresql.org (Postfix) with ESMTP id 99311925DA1 for ; Fri, 23 May 2003 09:25:17 -0400 (EDT) Received: from matrix.gatewaynet.com (localhost [127.0.0.1]) by matrix.gatewaynet.com (8.12.5/8.12.5) with ESMTP id h4NITxEP031365; Fri, 23 May 2003 16:29:59 -0200 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.5/8.12.5/Submit) with ESMTP id h4NITiUL031361; Fri, 23 May 2003 16:29:44 -0200 Date: Fri, 23 May 2003 16:29:44 -0200 (GMT+2) From: Achilleus Mantzios To: Christoph Haller Cc: pgsql-sql@postgresql.org, Subject: Re: Inquiry From Form [pgsql] In-Reply-To: <3ECE04E1.86BE5143@rodos.fzk.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new X-Archive-Number: 200305/470 X-Sequence-Number: 13635 On Fri, 23 May 2003, Christoph Haller wrote: > > > > I am using Java language for getting first 10 records from the table > in postgres. > > I dont know how to fetch 10 records from the table. > > Raj > > Could you try selecy name from bar where serves_greek_tsipouro order by price limit 10; > First answer is RTFM. But within psql you can fetch like this: > > begin; > declare fu cursor for select * from foo; > fetch 10 in fu; > fetch 10 in fu; > ... > close fu; > end; > > Does this answer your question? > > Regards, Christoph > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-210-8981112 fax: +30-210-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr