id | low_esn | high_esn
------+---------+----------
101 | 15900 | 15999
102 | 15900 | 15999
103 | 15900 | 15999
what I need to do is convert this to :
id | values
-----+--------
101 | 15900
101 | 15901
101 | 15902
...
101 | 15998
101 | 15999
102 | 15900
102 | 15901
102 | 15902
...
102 | 15998
102 | 15999
I was able to get to the first step of at least getting everything in two columns - but without something like Oracle's CONNECT BY, Postgres's generate_series(), etc. I cannot figure out how to "fill in" the gaps:
Code: Select all
select id, c as values
from (select id,
low_esn c
from udr_range
union all
select id,
high_esn c
from udr_range) subq
order by 1;
Does anyone know how to do this in the SQL environment of Vertica?