pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Stefan Becker <pgsql@yukonho.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: how do I to generate a sequence Range or Set of integer constants
Date: Fri, 23 Feb 2007 13:32:44 -0600
Message-ID: <1172259164.20651.9.camel@state.g2switchworks.com> (raw)
In-Reply-To: <200702231925.35411.pgsql@yukonho.de>
References: <200702231925.35411.pgsql@yukonho.de>

On Fri, 2007-02-23 at 12:25, Stefan Becker wrote:
> dear SQL friends,
> 
> What I want to do might be done differantly.  Right now I can't
> think of another solution other than a select statement
> 
> I would like to create a sequence range of integer constants.  Join
> this sequence against a ID Range in a database and look for missing
> Id's.   
> 
> Another application for this would be to simply populate a database with
> say 1000..9999 Records....
> 
> Now:  Is there a syntax that allows for the following.....
> 
> create table XX (id int);
> insert into XX (select  xx from "1 to 1000" of integers)
> 
> or...
> 
> select IntSeq.MissingValues, x.UniqIntId,x.A,x.B,x.C, 
> from MyDataTable x
> left outer join 
> (
>  select  MissingValues from "1 to 1000" of integers
> ) IntSeq on MissingValues=x.UniqIntId

 select * from generate_series(1,1000);




view thread (4+ messages)  latest in thread

Message-ID: <1172259164.20651.9.camel@state.g2switchworks.com>
Permalink:  ../1172259164.20651.9.camel@state.g2switchworks.com/
Also on:    postgresql.org/message-id/1172259164.20651.9.camel@state.g2switchworks.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: smarlowe@g2switchworks.com, pgsql@yukonho.de
  Subject: Re: how do I to generate a sequence Range or Set of integer constants
  In-Reply-To: <1172259164.20651.9.camel@state.g2switchworks.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox