X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0EB4D52A35 for ; Wed, 13 Jul 2005 06:13:13 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 69811-04 for ; Wed, 13 Jul 2005 09:13:12 +0000 (GMT) Received: from mxsrv01.cenix-bioscience.com (exon.cenix-bioscience.com [145.253.108.42]) by svr1.postgresql.org (Postfix) with ESMTP id 90E2E529B1 for ; Wed, 13 Jul 2005 06:13:10 -0300 (ADT) Received: by mxsrv01.cenix-bioscience.com (Cenix-Mailer, from userid 65534) id E503A1353DD; Wed, 13 Jul 2005 11:13:09 +0200 (CEST) Received: from mxsrv01.cenix-bioscience.com (localhost [127.0.0.1]) by mxsrv01-sf.cenix-bioscience.com (Cenix-Mailer) with ESMTP id 48A291353DA for ; Wed, 13 Jul 2005 11:13:07 +0200 (CEST) Received: from lynx.cenix-bioscience.com (unknown [192.168.1.33]) by mxsrv01.cenix-bioscience.com (Cenix-Mailer) with ESMTP id 1FA411353D3 for ; Wed, 13 Jul 2005 11:13:07 +0200 (CEST) From: Aaron Bingham To: pgsql-sql@postgresql.org Subject: Generating a range of integers in a query Date: Wed, 13 Jul 2005 11:13:06 +0200 Message-ID: User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200507/107 X-Sequence-Number: 22085 Hello, I've got an interesting problem: I need to select all possible values of an attribute that do /not/ occur in the database. This would be easy (in my case at least) if there were a way to generate a table containing all integers between 1 and n, where n is the result of a subquery. In my case, n will be at most a few hundred. I would like to be able to generate this table as a subquery. Any ideas? Thanks, -- -------------------------------------------------------------------- Aaron Bingham Senior Software Engineer Cenix BioScience GmbH --------------------------------------------------------------------