Generate value based on start and end columns without using procedure.
How to modify the select query.
select key_column, start_point, end_point FROM tab1 WHERE key_column='10254';
key_column start_point end_point
10254 -2 5
Expected output:-
key_column points
10254 -2
10254 -1
10254 0
10254 1
10254 2
10254 3
10254 4
10254 5
Looks like a standard group by to me...
with rws as (
select 10254 ky, -2 val from dual union all
select 10254 ky, -1 val from dual union all
select 10254 ky, 0 val from dual union all
select 10254 ky, 1 val from dual union all
select 10254 ky, 2 val from dual union all
select 10254 ky, 3 val from dual union all
select 10254 ky, 4 val from dual union all
select 10254 ky, 5 val from dual
)
select ky, min ( val ), max ( val )
from rws
group by ky;
KY MIN(VAL) MAX(VAL)
10254 -2 5