Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 58E3A9FA2CB for ; Thu, 30 Nov 2006 14:35:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-new, port 10024) with ESMTP id 80375-09 for ; Thu, 30 Nov 2006 14:35:37 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.170]) by postgresql.org (Postfix) with ESMTP id 630FD9FA17F for ; Thu, 30 Nov 2006 14:35:38 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id k3so1980090ugf for ; Thu, 30 Nov 2006 10:35:36 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=Lf9XNybzBW5IjGGKRhatq4hpT9g78K74ovpnWwvdTiK5m1sAkfhmjDKd6SjsV0j7ZMgqlLqyO9Pxm8Ryz4Su27/un+0tl0Znu0EKuWUzOa6a4gV/3rUa5M3Yoef+RMkrno/Tfy/S3kyCpALgyBAw7VT1QewpmTVjBpWI4H1jUq0= Received: by 10.78.136.9 with SMTP id j9mr3881099hud.1164911736421; Thu, 30 Nov 2006 10:35:36 -0800 (PST) Received: by 10.78.136.6 with HTTP; Thu, 30 Nov 2006 10:35:36 -0800 (PST) Message-ID: Date: Thu, 30 Nov 2006 12:35:36 -0600 From: "Aaron Bono" To: "Ezequias Rodrigues da Rocha" Subject: Re: Select (1-3) Cc: pgsql-sql@postgresql.org In-Reply-To: <55c095e90611301030t6b380e64rc3b614acd5759297@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_42710_22586113.1164911736268" References: <55c095e90611301030t6b380e64rc3b614acd5759297@mail.gmail.com> X-Google-Sender-Auth: 78ea6d5b75128bfb X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200611/300 X-Sequence-Number: 26952 ------=_Part_42710_22586113.1164911736268 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/30/06, Ezequias Rodrigues da Rocha wrote: > > Hi list, > > It is possible to make a selection like > > Select (list 1 to 1000); > > And get the rows ? > > producao=# select ...; > row > --------- > 1 > 2 > 3 > . > . > . > 1000 > *select * from generate_series(1, 1000);* See http://oreillynet.com/pub/a/databases/2006/09/07/plpgsql-batch-updates.html?page=2 -- ================================================================== Aaron Bono Aranya Software Technologies, Inc. http://www.aranya.com http://codeelixir.com ================================================================== ------=_Part_42710_22586113.1164911736268 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/30/06, Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> wrote:
Hi list,

It is possible to make a selection like

Select (list 1 to 1000);

And get the rows ?

producao=# select ...;
   row
---------
   1
   2
   3
.
.
.
1000

select * from generate_series(1, 1000);

See http://oreillynet.com/pub/a/databases/2006/09/07/plpgsql-batch-updates.html?page=2

--
==================================================================
   Aaron Bono
   Aranya Software Technologies, Inc.
   http://www.aranya.com
   http://codeelixir.com
================================================================== ------=_Part_42710_22586113.1164911736268--