[Oracle]快速生成大量模拟数据的方法
2017-09-26 13:15
513 查看
快速生成大量模拟数据的方法:
create table TEST(id integer, TEST_NUMBER NUMBER(18,6));
insert into TEST
select i+j, i+j
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
);
这是生成10万条数据
如果生成1000完条数据,则变成:
create table TEST(id integer, TEST_NUMBER NUMBER(18,6));
insert into TEST
select i+j, i+j
from (
with DATA2(j) as (
select 0 j from DUAL
union all
select j+1000 from DATA2 where j < 99990000
)
select j from DATA2
),
(
with DATA1(i) as (
select 1 i from DUAL
union all
select i+1 from DATA1 where i < 10000
)
select i from DATA1
);
create table TEST(id integer, TEST_NUMBER NUMBER(18,6));
insert into TEST
select i+j, i+j
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
);
这是生成10万条数据
如果生成1000完条数据,则变成:
create table TEST(id integer, TEST_NUMBER NUMBER(18,6));
insert into TEST
select i+j, i+j
from (
with DATA2(j) as (
select 0 j from DUAL
union all
select j+1000 from DATA2 where j < 99990000
)
select j from DATA2
),
(
with DATA1(i) as (
select 1 i from DUAL
union all
select i+1 from DATA1 where i < 10000
)
select i from DATA1
);
相关文章推荐
- oracle 快速删除大批量数据方法(全部删除,条件删除,删除大量重复记录)
- oracle 快速删除大批量数据方法(全部删除,条件删除,删除大量重复记录)
- [Oracle]快速构造大量数据的方法
- oracle 快速删除大批量数据方法(全部删除,条件删除,删除大量重复记录)
- oracle 快速删除大批量数据方法(全部删除,条件删除,删除大量重复记录) 转
- Oracle中如何用一条SQL快速生成1大量测试数据
- oracle 快速删除大批量数据方法(全部删除,条件删除,删除大量重复记录)
- oracle 快速删除大批量数据方法(全部删除,条件删除,删除大量重复记录)
- Oracle中如何用一条SQL快速生成10万条测试数据
- Oracle 不同用户之间 大量数据转移的方法测试
- oracle生成测试数据的简单方法
- 生成大量的测试数据的三种方法,1写sql,2工具plsql,3LoadRunner
- Oracle中如何用一条SQL快速生成10万条测试数据
- Oracle 不同用户之间 大量数据转移的方法测试
- Oracle 不同用户之间 大量数据转移的方法测试
- Oracle 快速load数据的方法--SQL*Loader
- Oracle 不同用户之间 大量数据转移的方法测试
- Oracle中如何用一条SQL快速生成10万条测试数据(转)
- Oracle 不同用户之间 大量数据转移的方法测试
- Oracle中如何用一条SQL快速生成10万条测试数据