Generate number series
Posted in 2010
Topics: SQL Development & Query Writing
Hi,
Is it possible to generate a series of numbers in a select statement?
For example, in Oracle one can use
SELECT LEVEL FROM DUAL CONNECT BY LEVEL <= Nwhich generates a series of numbers upto N.
Basically I want to generate a datetime(with 1,5,10,15... min steps) by first
generating a number series and adding it to a date.
Use a stored procedure.
Art
Art S. Kagel
Advanced DataTools (www.advancedatatools.com)
IIUG Board of Directors (art@iiug.org)
Disclaimer: Please keep in mind that my own opinions are my own opinions and
do not reflect on my employer, Advanced DataTools, the IIUG, nor any other
organization with which I am associated either explicitly, implicitly, or by
inference. Neither do those opinions reflect those of other individuals
affiliated with any entity with which I am affiliated nor those of the
entities themselves.
On Tue, Jul 6, 2010 at 3:24 PM, RANDOM NET <random_net@yahoo.com> wrote:
> Hi,
>
> Is it possible to generate a series of numbers in a select statement?
> For example, in Oracle one can use
> SELECT LEVEL FROM DUAL CONNECT BY LEVEL <= N> which generates a series of numbers upto N.
>
> Basically I want to generate a datetime(with 1,5,10,15... min steps) by
> first
> generating a number series and adding it to a date.
>
>
>
>
*******************************************************************************
> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
--000e0cd32b78cdd9b2048abd0916
It's nearly the same in INFORMIX (Version 11.5):
SELECT LEVEL FROM sysmaster:sysdual CONNECT BY LEVEL <=3D 10
-----Urspr=C3=BCngliche Nachricht-----
Von: RANDOM NET <random_net@yahoo.com>
Gesendet: Jul 6, 2010 9:24:20 PM
An: ids@iiug.org
Betreff: Generate number series [20526]
>Hi,=20
>
>Is it possible to generate a series of numbers in a select statement?=20
>For example, in Oracle one can use=20
>SELECT LEVEL FROM DUAL CONNECT BY LEVEL <=3D N=20>which generates a series of numbers upto N.=20
>
>Basically I want to generate a datetime(with 1,5,10,15... min steps) by fi=
rst=20
>generating a number series and adding it to a date.=20
>
>
>**************************************************************************=
*****=20
> Forum Note: Use "Reply" to post a response in the discussion forum.=20
>
___________________________________________________________
GRATIS f=C3=BCr alle WEB.DE Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de