| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Select enumeration of intergers
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 - 11:29:57 CDT
![]() |
![]() |