table A 三个字段
code start end
A 1 5
B 4 7
C 10 14
........
写个select 语句得到如下结果
code number
A 1
A 2
A 3
A 4
A 5B 4
B 5
B 6
B 7C 10
C 11
C 12
C 13
C 14
code start end
A 1 5
B 4 7
C 10 14
........
写个select 语句得到如下结果
code number
A 1
A 2
A 3
A 4
A 5B 4
B 5
B 6
B 7C 10
C 11
C 12
C 13
C 14
select
A.code,(A.start+B.id) as number
from
A,(select 0 as id union select 1 union select 2 union ... union select 10) B
where
A.start+B.id<=A.end
实际中
最大跨度为1000
from a,(select rownum n from all_objects) b
where b.n>=a.start and b.n<=a.end
from a,(select rownum n from all_objects) b
where b.n>=a.start and b.n<=a.end
-------------
厉害,膜拜一下