SQL> select * from A;B1 B2 ------------------------------ ----------- K1280 2003-8-21SQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> select * from A;B1 B2 ------------------------------ ----------- K1280 2003-8-23 K1280 2003-8-24 K1280 2003-8-25 K1280 2003-8-21 K1280 2003-8-22SQL>
------------------------------ -----------
K1280 2003-8-21SQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> insert into A select b1,max(b2)+1 from A group by b1;1 row insertedSQL> select * from A;B1 B2
------------------------------ -----------
K1280 2003-8-23
K1280 2003-8-24
K1280 2003-8-25
K1280 2003-8-21
K1280 2003-8-22SQL>
K1280 2003/08/21 2033/08/25
这条记录是有两个时间点的
生成的记录的个数是由这两个时间点之间的天数决定的
而且生成的记录必须是在这两个时间点之间的连续天数
例如上面的记录一定要生成这样的记录才行的
K1280 2003/08/21
K1280 2003/08/22
K1280 2003/08/23
K1280 2003/08/24
K1280 2003/08/25
select K_name, startday + rownum -1
from a,emp
where rownum <= endday - startday + 1
select K_name, startday + rownum -1
from a ,emp
where rownum <= endday - startday + 1
原表是a,
select a.'k1280',b.time from a,b where b.time >='2003/08/21'
and b.time <='2003/08/25'