Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 92CE19FBBA6 for ; Wed, 2 May 2007 21:35:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 27897-05 for ; Wed, 2 May 2007 21:35:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from web31808.mail.mud.yahoo.com (web31808.mail.mud.yahoo.com [68.142.207.71]) by postgresql.org (Postfix) with SMTP id CB6379FBB75 for ; Wed, 2 May 2007 21:35:04 -0300 (ADT) Received: (qmail 74072 invoked by uid 60001); 3 May 2007 00:35:03 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=OV/lbTPozIPowAFvuPbRzijw4IqRVWLNpQc/6KTwAccGzKN6EaR8eseoO4rNByyMGDi55/3fIXFQA2pUnSpJezWVaTAk6NfZ1S5EE49kSeZOfIe8Io2/sEPeDmNJ3LNME6XXcdXcVuhYchtczDkO6vzDoWg8lN0ksMbfhoLOAAk=; X-YMail-OSG: 7.aSaRUVM1k56qoPxUVd0gFC_6TJDeNty_UcZ3L7zwqvFGd9UMLmx88jXzgPTKuMyLkuGQ-- Received: from [75.84.89.248] by web31808.mail.mud.yahoo.com via HTTP; Wed, 02 May 2007 17:35:02 PDT Date: Wed, 2 May 2007 17:35:02 -0700 (PDT) From: Richard Broersma Jr Subject: Re: Joe Celko's method to "generate_series" not working? To: Richard Broersma Jr , SQL Postgresql List In-Reply-To: <649296.88043.qm@web31815.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <105002.73150.qm@web31808.mail.mud.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.439 tagged_above=0 required=5 tests=AWL=0.438, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200705/10 X-Sequence-Number: 28291 --- Richard Broersma Jr wrote: > Is Mr. Celko mistaken? Does anyone know if PostgreSQL has any functions that I can turn these > VALUES rows into columns so that the CROSS JOINS will work? Having posted, I just realized what the correct syntax is: SELECT hundred * 100 + ten * 10 + unit + 1 FROM ( VALUES( 0 ), ( 1 ), ( 2 ), ( 3 ), ( 4 ), ( 5 ), ( 6 ), ( 7 ), ( 8 ), ( 9 ) ) AS Units( unit ) CROSS JOIN ( VALUES( 0 ), ( 1 ), ( 2 ), ( 3 ), ( 4 ), ( 5 ), ( 6 ), ( 7 ), ( 8 ), ( 9 ) ) AS Tens( ten ) CROSS JOIN ( VALUES( 0 ), ( 1 ), ( 2 ), ( 3 ), ( 4 ), ( 5 ), ( 6 ), ( 7 ), ( 8 ), ( 9 ) ) AS Hundreds( hundred ) ORDER BY hundred * 100 + ten * 10 + unit + 1 ; Sorry for the noise. :o( Regards, Richard Broersma Jr.