zoukankan      html  css  js  c++  java
  • [Oracle]快速生成大量模拟数据的方法

    快速生成大量模拟数据的方法:

    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
             );

  • 相关阅读:
    ql语句中left join和inner join中的on与where的区别分析
    C#如何通过属性名称反射出属性本身
    mvc中查询字符串请求过长
    SQL Server 中 EXEC 与 SP_EXECUTESQL 的区别
    后台二进制文件 在前台下载方法总结
    C#中try catch finally的执行顺序
    python生成随机密码
    Bridged(桥接模式)
    NAT(地址转换模式)
    TCP协议详解
  • 原文地址:https://www.cnblogs.com/gaojian/p/7596248.html
Copyright © 2011-2022 走看看