[Oracle]快速构造大量数据的方法:
create table tab001(id integer primary key, val varchar2(100));
insert into tab001
select i+j,rpad(to_char(i+j),100,'A')
from (
with DATA2(j) as (
select 0 j from DUAL
union all
select j+1000 from DATA2 where j < 999000
)
select j from DATA2
),
(
with DATA1(i) as (
select 1 i from DUAL
union all
select i+1 from DATA1 where i < 1000
)
select i from DATA1
create table tab001(id integer primary key, val varchar2(100));
insert into tab001
select i+j,rpad(to_char(i+j),100,'A')
from (
with DATA2(j) as (
select 0 j from DUAL
union all
select j+1000 from DATA2 where j < 999000
)
select j from DATA2
),
(
with DATA1(i) as (
select 1 i from DUAL
union all
select i+1 from DATA1 where i < 1000
)
select i from DATA1
);
本文转自健哥的数据花园博客园博客,原文链接:http://www.cnblogs.com/gaojian/p/huge_data.html,如需转载请自行联系原作者