我有一个有两列的表; EVENT_DATE
日期和RANG
数字第一列包含事件的日期,而第二列包含该事件的期间。这是一个数据样本
| EVENT_DATE | RANG |
|------------|------|
| 03/01/2015 | 1 |
| 09/04/2015 | 3 |
| 15/10/2015 | 2 |
有没有办法通过基于EVENT_DATE
值递增RANG
来扩展| EVENT_DATE |
|------------|
| 03/01/2015 |
| 04/01/2015 |
| 09/04/2015 |
| 10/04/2015 |
| 11/04/2015 |
| 12/04/2015 |
| 15/10/2015 |
| 16/10/2015 |
| 17/10/2015 |
,所以输出就像,
{{1}}
答案 0 :(得分:2)
你走了。
select to_char(event_date + (l - 1),'dd/mm/yyyy') from tab1 t
left outer join (
select level l from dual
connect by level <= (select max(rang) + 1 from tab1)
) on l <= rang + 1
order by event_date, 1;
答案 1 :(得分:1)
这应该有效:
select (t.event_date + t2.value) as event_date
from t, (select rownum -1 as value from all_objects) t2
where t2.value <= t.rang
order by 1 asc;
答案 2 :(得分:0)
另一个可能的答案。假设myObj["foo"] = []
是你的表
Event1