Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Getting NON-existing data

Re: Getting NON-existing data

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Thu, 24 Jun 1999 21:50:16 +0800
Message-ID: <37723798.3E72@yahoo.com>


Kevin P. Fleming wrote:
>
> This would work, although it's ugly...
>
> SELECT 1 FROM DUAL
> UNION
> SELECT 2 FROM DUAL
> UNION
> SELECT 3 FROM DUAL
> UNION
> etc....
>
> C. <c_ferguson_at_rationalconcepts.com> wrote in message
> news:3771D984.366236C5_at_rationalconcepts.com...
> > Hi,
> > Create a sequence.
> > C. Ferguson, Rational Concepts.
> >
> > Niek Kerkemeijer wrote:
> >
> > > Hi,
> > >
> > > I have a nice question:
> > > I need oracle to generate a number-range for me without having
> > > a table containing these values.
> > >
> > > Example:
> > > I have an empty database (there are no tables in it) and I need
> > > a query which results in the following:
> > >
> > > +------+
> > > | id |
> > > +------+
> > > | 1 |
> > > | 2 |
> > > | 3 |
> > > | 4 |
> > > | 5 |
> > > | 6 |
> > > | 7 |
> > > | 8 |
> > > | 9 |
> > > | 10 |
> > > +------+
> > >
> > > Any ideas?
> > >
> > > Niek.
> >
> >

A common trick is to create a single table (like DUAL) called BIGDUAL or something...

create table BIGDUAL as
select rownum from user_source (or whatever);

Then use it in queries all over the place... --



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Thu Jun 24 1999 - 08:50:16 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US