Oracle随机函数之dbms_random使用详解建站知识
导读:1建站知识dbms_random是oracle提供的一个随机函数包,本文将详细介绍函数的使用,需要的朋友可以参考下营销型网站建设seo网站关键词优化。
dbms_random是oracle提供的一个随机函数包,以下介绍一些dbms_random的常用示例: dbms_random.value用法: 生成一个大于等于0,小于等于1的38位小数
复制代码 代码如下:
-- FUNCTION value RETURN NUMBER; select dbms_random.value from dual; SQL> select dbms_random.value from dual; VALUE ---------- 0.61011338
复制代码 代码如下:
-- FUNCTION value RETURN NUMBER; select dbms_random.value from dual; SQL> select dbms_random.value from dual; VALUE ---------- 0.61011338
生成一个指定范围内的数</ p>复制代码 代码如下:
select dbms_random.value(100,0) from dual; SQL> select dbms_random.value(100,0) 2 from dual; DBMS_RANDOM.VALUE(100,0) ------------------------ 20.7742244285517
复制代码 代码如下:
-- FUNCTION value (low IN NUMBER, high IN NUMBER) RETURN NUMBER; select dbms_random.value(100,0) from dual; SQL> select dbms_random.value(100,0) 2 from dual; DBMS_RANDOM.VALUE(100,0) ------------------------ 20.7742244285517
dbms_random.normal用法 获取正态分布的随机数复制代码 代码如下:
select dbms_random.normal from dual; SQL> select dbms_random.normal from dual; NORMAL ---------- -1.7330759
复制代码 代码如下:
select dbms_random.normal from dual; SQL> select dbms_random.normal from dual; NORMAL ---------- -1.7330759
dbms_random.string用法 获取指定字符串复制代码 代码如下:
企业网站建设/* "opt" specifies that the returned string may contain: 'u','U' : upper case alpha charact网站建设ers only 'l','L' : lower case alpha characters only 'a','A' : alpha characters only (mixed case) 'x','X' : any alpha-numeric characters (upper) 'p','P' : any printable characters */ SQL> select dbms_random.string('u',10) from dual union all select dbms_random.string('Useo网站优化软件',10) from dual union all select dbms_random.string('l',10) from dual union all select dbms_random.string('L',10) from dual union all select dbms_random.string('a',10) from dual union all select dbms_random.string('A',10) from dual union all select dbms_random.string('x',10) from dual union all select dbms_random.string('X',10) from dual union all select dbms_random.string('P',10) from dual union all select dbms_random.string('P',10) from dual;
复制代码 代码如下:
--FUNCTION string (opt char, len NUMBER) /* "opt" specifies that the returned string may contain: 'u','U' : upper case alpha characters only 'l','L' : lower case alpha characters only 'a','A' : alpha characters only (mixed case) 'x','X' : any alpha-numeric characters (upper) 'p','P' : any printable characters */ SQL> select dbms_random.string('u',10) from dual union all select dbms_random.string('U',10) from dual union all select dbms_random.string('l',10) from dual union all select dbms_random.string('L',10) from dual union all select dbms_random.string('a',10) from dual union all select dbms_random.string('A',10) from dual union all select dbms_random.string('x',10) from dual union all select dbms_random.string('X',10) from dual union all select dbms_random.string('P',10) from dual union all select dbms_random.string('P',10) from dual;
声明: 本文由我的SEOUC技术文章主页发布于:2023-05-24 ,文章Oracle随机函数之dbms_random使用详解建站知识主要讲述详解,函数,Oracle随机函数之dbms_random使用网站建设源码以及服务器配置搭建相关技术文章。转载请保留链接: https://www.seouc.com/article/web_6300.html