Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: returning a constant set of numbers from a "select"
> > same problem as before - it uses a table. I am after a non-table > based solution ideally. >
OK, try this. Only goes up to 127, but you can see how to extend it.
select (((((t0.bit * 2 + t1.bit) * 2 + t2.bit) * 2 + t3.bit) * 2 + t4.bit) *
2 + t5.bit) * 2 + t6.bit
from
(select 0 as bit from dual union select 1 from dual) t0,
(select 0 as bit from dual union select 1 from dual) t1,
(select 0 as bit from dual union select 1 from dual) t2,
(select 0 as bit from dual union select 1 from dual) t3,
(select 0 as bit from dual union select 1 from dual) t4,
(select 0 as bit from dual union select 1 from dual) t5,
(select 0 as bit from dual union select 1 from dual) t6
order by t0.bit, t1.bit, t2.bit, t3.bit, t4.bit, t5.bit, t6.bit;
Received on Mon Jul 21 2003 - 09:26:07 CDT
![]() |
![]() |