标签:cot trunc mil and ora rand 年龄 creat --
1 --生成随机表
2 --CREATE table scott.One_Million as (
3 SELECT ROWNUM AS T_ID,
4 TRUNC(DBMS_RANDOM.VALUE(0, 100)) 年龄,
5 DECODE(DBMS_RANDOM.STRING(0, 1),
6 ‘A‘,
7 ‘张‘,
8 ‘B‘,
9 ‘周‘,
10 ‘C‘,
11 ‘李‘,
12 ‘D‘,
13 ‘赵‘,
14 ‘E‘,
15 ‘安‘,
16 ‘F‘,
17 ‘王小‘,
18 ‘小‘) ||
19 DECODE(DBMS_RANDOM.STRING(0, 1),
20 ‘A‘,
21 ‘娜‘,
22 ‘B‘,
23 ‘娟‘,
24 ‘C‘,
25 ‘梅‘,
26 ‘D‘,
27 ‘美‘,
28 ‘E‘,‘鹏‘,
29 (DBMS_RANDOM.STRING(1,1))) AS 姓名,
30 to_char(sysdate-TRUNC(DBMS_RANDOM.VALUE(1,1000000000))/24/60/60,‘yyyy-mm-dd hh24:mi:ss‘) 生日,
31 trunc(DBMS_RANDOM.VALUE(100000000,900000000)) 编号,
32 DBMS_RANDOM.STRING(1,25) 字符串
33 FROM DUAL
34 CONNECT BY LEVEL <= 1000000
35
36 --)
标签:cot trunc mil and ora rand 年龄 creat --
原文地址:http://www.cnblogs.com/wjsharp/p/6146218.html