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

Home -> Community -> Usenet -> c.d.o.misc -> Re: returning a constant set of numbers from a "select"

Re: returning a constant set of numbers from a "select"

From: Alan Mills <Alan.Mills_at_xservices.pants.fujitsu.com>
Date: Mon, 21 Jul 2003 14:20:15 +0100
Message-ID: <bfgpbj$1n4p$1@news.icl.se>

"p!" <p!@unix.ndo.co.uk> wrote in message news:3f1be5ed.15540453_at_news...
> hi,
>
> could anyone tell me how i can do the following:
>
> would like a select statement which returns all the numbers between a
> variable start and end point as seperate rows without using a "proper"
> table, ie:
>
> result
> ----------
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
> ..
> 1000
>
>
> any ideas?!
>
> thanks,
> p!

How about

SELECT ROWNUM FROM MyLargeTable
WHERE ROWNUM <= MyUpperBound

and then could add an offset to ROWNUM if you want to start at a particular number.

Try that. Received on Mon Jul 21 2003 - 08:20:15 CDT

Original text of this message

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