發表文章

目前顯示的是有「亂數」標籤的文章

Oracle 取亂數的方法

使用 DBMS.RANDOM 來取得亂數值 隨機取亂數 select dbms_random.random from dual; 取0到1的亂數 select dbms_random.avlue from dual; 取指定範圍的亂數 select dbms_random.value(1, 1000) num from dual; 取20個隨機英文字-大寫 select dbms_random.string('U', 20) str from dual; 取20個隨機英文字-小寫 select dbms_random.string('L', 20) str from dual; 取20個隨機英文+符號-大寫 select dbms_random.string('A', 20) str from dual; 取20個隨機英文+符號-小寫 select dbms_random.string('X', 20) str from dual; reference web: http://www.databasejournal.com/features/oracle/article.php/3341051/Generating-random-numbers-and-strings-in-Oracle.htm