Say the maximum difference between two values is 500. Then you can do this by creating a table with numbers and using join
. Here is an example:
with nums as (
select level as lvl from dual
connect by level < 500
)
select (st.from_value + n.lvl - 1) as value, st.date_1
from sach_temp st join
nums n
on st.from_value + n.lvl - 1<= st.to_value;
EDIT:
You don't have to guess at the maximum value. You can calculate that:
with vmax as (
select max(to_value - from_value + 1) as vmax
from sach_temp
),
nums as (
select level as lvl from vmax
connect by level < vmax.vmax
)
select (st.from_value + n.lvl - 1) as value, st.date_1
from sach_temp st join
nums n
on st.from_value + n.lvl - 1<= st.to_value;