Oracle 產生一張測試表並插入隨機資料

來源:互聯網
上載者:User

標籤: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 DUAL34 CONNECT BY LEVEL <= 100000035 36 --)

 

Oracle 產生一張測試表並插入隨機資料

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.