51Testing软件测试论坛

标题: 【我分享】一个造百万数据的SQL [打印本页]

作者: LorrieL    时间: 2014-12-30 14:22
标题: 【我分享】一个造百万数据的SQL

create table emp
partition by RANGE(deptno)
( partition PART01 values less than (50000),
partition PART02 values less than (100000),
partition PART03 values less than (300000),
partition PART04 values less than (500000),
partition PART05 values less than (7000000),
partition PARTMAX values less than (MAXVALUE) )
      tablespace Test
      
  as select
  level as empno,
  dbms_random.string('A',30) as ename,
  dbms_random.string('B',7) as job,
  sysdate - mod(level,100) as hire_date,
  dbms_random.value(1,1000) as comm, dbms_random.value(1,10000) as salary,
  mod(level,1000000)+1 as deptno
   from dual
   connect by level <= 1000000;





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2