Oracle随机生成一张有数据的表
CREATE table scott.One_Million as (
SELECT ROWNUM AS T_ID,
TRUNC(DBMS_RANDOM.VALUE(0, 100)) 年龄,
DECODE(DBMS_RANDOM.STRING(0, 1),
'A',
'张',
'B',
'周',
'C',
'李',
'D',
'赵',
'E',
'安',
'F',
'王小',
'小') ||
DECODE(DBMS_RANDOM.STRING(0, 1),
'A',
'娜',
'B',
'娟',
'C',
'梅',
'D',
'美',
'E','鹏',
(DBMS_RANDOM.STRING(1,1))) AS 姓名,
to_char(sysdate-TRUNC(DBMS_RANDOM.VALUE(1,1000000000))/24/60/60,'yyyy-mm-dd hh24:mi:ss') 生日,
trunc(DBMS_RANDOM.VALUE(100000000,900000000)) 编号,
DBMS_RANDOM.STRING(1,25) 字符串
FROM DUAL
CONNECT BY LEVEL <= 1000000