Re: Select enumeration of intergers

From: Cimode <cimode_at_hotmail.com>
Date: 6 Jul 2006 12:13:33 -0700
Message-ID: <1152213213.243953.211180_at_s53g2000cws.googlegroups.com>


there are about 3 methods on SQL server. None is response time performant.
frebe73_at_gmail.com wrote:
> I need to make a select statements according to this:
>
> select value
> from all_integers
> where value => 510 and value < 515
>
> The result should be:
> 510
> 511
> 512
> 513
> 514
>
> Any idea how to define the view "all_integers"? I prefer a solution for
> MySQL, but solution for other vendors would be appreciated too.
>
> I alread tried the solution below but the performance is too bad
>
> create view digits as
> select 0 as digit from dual
> union
> select 1 from dual
> union
> select 2 from dual
> ....
> union
> select 9 from dual
>
> create view all_integers as
> select
> d1.digit + d2.digit*10 + d3.digit*100 + .... + d10.digit*10000000000
> from digits d1, digits d2, digits d3, .... , digits d4
>
> /Fredrik
Received on Thu Jul 06 2006 - 21:13:33 CEST

Original text of this message