Functions in the Oracle database

Source: Internet
Author: User

1, random number function: Dbms_random. RANDOM

1 SELECT ABS(MOD (Dbms_random. RANDOM, -)) fromDUAL;--generate a random number within 1002 SELECTTRUNC ( -+ the*Dbms_random.value) fromDual--generates a random number between 100~10003 SELECTDbms_random.value fromDual--generates a random number between 0~14 SELECTDbms_random.value (Ten, -) fromDual--generates a random number between 10~205 SELECTDbms_random.normal fromDual--The normal function returns a set of numbers that obey a normal distribution

SELECT  from dual;  -- Generate random string returns a random string of up to 60 characters in length. (not tested successfully)select dbms_random.string ('P',  Dual; The first argument P means printable, that is, the string is made up of any printable character the second parameter represents the return string length selectfrom  table  order by Dbms_random.value;  -- randomly fetching the URL of a record from a table

2.

Functions in the Oracle database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.