with dimension as (
select 0 as point from dual
union all
select level
from dual
connect by level <= 10
), points as (
select
a.point as startpoint,
b.point as endpoint,
c.point as fixed
from dimension a
cross join dimension b
cross join dimension c
where b.point - a.point = 1
)
select
startpoint as startpoint_x,
fixed as startpoint_y,
endpoint as endpoint_x,
fixed as endpoint_y
from points
union all
select
fixed as startpoint_x,
startpoint as startpoint_y,
fixed as endpoint_x,
endpoint as endpoint_y
from points
order by startpoint_y, endpoint_y, startpoint_x, endpoint_x
| STARTPOINT_X | STARTPOINT_Y | ENDPOINT_X | ENDPOINT_Y | 0 | 0 | 1 | 0 | 1 | 0 | 2 | 0 | 2 | 0 | 3 | 0 | 3 | 0 | 4 | 0 | 4 | 0 | 5 | 0 | 5 | 0 | 6 | 0 | 6 | 0 | 7 | 0 | 7 | 0 | 8 | 0 | 8 | 0 | 9 | 0 | 9 | 0 | 10 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 2 | 0 | 2 | 1 | 3 | 0 | 3 | 1 | 4 | 0 | 4 | 1 | 5 | 0 | 5 | 1 | 6 | 0 | 6 | 1 | 7 | 0 | 7 | 1 | 8 | 0 | 8 | 1 | 9 | 0 | 9 | 1 | 10 | 0 | 10 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 2 | 1 | 2 | 1 | 3 | 1 | 3 | 1 | 4 | 1 | 4 | 1 | 5 | 1 | 5 | 1 | 6 | 1 | 6 | 1 | 7 | 1 | 7 | 1 | 8 | 1 | 8 | 1 | 9 | 1 | 9 | 1 | 10 | 1 | 0 | 1 | 0 | 2 | 1 | 1 | 1 | 2 | 2 | 1 | 2 | 2 | 3 | 1 | 3 | 2 | 4 | 1 | 4 | 2 | 5 | 1 | 5 | 2 | 6 | 1 | 6 | 2 | 7 | 1 | 7 | 2 | 8 | 1 | 8 | 2 | 9 | 1 | 9 | 2 | 10 | 1 | 10 | 2 | 0 | 2 | 1 | 2 | 1 | 2 | 2 | 2 | 2 | 2 | 3 | 2 | 3 | 2 | 4 | 2 | 4 | 2 | 5 | 2 | 5 | 2 | 6 | 2 | 6 | 2 | 7 | 2 | 7 | 2 | 8 | 2 |
|---|