Generating a range of integers in a query

From: Aaron Bingham <bingham(at)cenix-bioscience(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Generating a range of integers in a query
Date: 2005-07-13 09:13:06
Message-ID: l87jfvcbml.fsf@lynx.cenix-bioscience.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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
--------------------------------------------------------------------

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Glaesemann 2005-07-13 10:20:55 Re: Generating a range of integers in a query
Previous Message Michael Fuhr 2005-07-13 02:08:47 Re: dynamically loaded functions