月关宝盒
Oracle:DBMS_RANDOM.VALUE函数1. 产生一个介于0和1之间(不包含0和1)的38位精度的随机数SQL> SELECT DBMS_RANDOM.VALUE FROM dual;VALUE----------.8810218592. 产生一个介于指定范围之内的38位精度的随机数SQL> SELECT DBMS_RANDOM.VALUE(1, 9999) FROM dual;DBMS_RANDOM.VALUE(1,9999)-------------------------4261.38448DB2db2 => SELECTdb2 (cont.) => RAND()db2 (cont.) => FROM SYSIBM.SYSDUMMY1;1------------------------+3.71105075228126E-0021 条记录已选择。db2 =>db2 => SELECTdb2 (cont.) => RAND()db2 (cont.) => FROM SYSIBM.SYSDUMMY1;1------------------------+1.65257728812525E-0011 条记录已选择。SQL Server1> SELECT RAND()2> go------------------------0.52387284052730643(1 行受影响)1> SELECT RAND()2> go------------------------0.92388223999987373(1 行受影响)