Oracle's single line function ___ static function

Source: Internet
Author: User
 Single line function

A function is the same as the functionality of a method in the Java language to perform functional support for certain operations. And now the Oracle database weight also contains a large number of single-line functions, these functions have mastered the Fang to help carry out the relevant development of the database

For developers, the most important thing is SQL syntax and Single-line functions, but the number of single line functions of Oracle is very much, syntax:

Function_name (column | expression [parameter 1, parameter 2])

Single-line functions are mainly divided into the following categories:

Character function: Accept data to return specific character information;

numeric function: Processing a number, such as rounding;

Date function: Directly related to the date of the operation;

Conversion functions: Date, character, number can be completed between the conversion function;

Common functions: Oracle's own feature-specific functions;

Single-line function--character function

Upper (column name | expression), character capitalization conversion function:

Selectupper (' SQL is used exclusively in RDBMSes ') from dual;

Initcap (column name | expression): This function is used to convert the first character of each word to uppercase, and the rest to lowercase: SELECT CONCAT (' SQL alows you tomanipulate the data in DB ', ' without any prog Ramming knowledge ') from dual;

substr (column name | expression, M,[n]): This function is used to return the top string, which starts with the first m character, and its length is N:elect substr (' SQL lets youconcentrate on what has to being done ', 14)

Length (column name | expression): This function is used to return the length of the string in the column or expression: Selectlength (' SQL does no let you concentrate on how it'll be achieved ') from dual;

InStr (Column name | expression, ' string ', [M],[n]): The function is used to return the numeric position of the given string, m means to start the search from the M character, n indicates the number of occurrences of the given string, and their default value is 1

Replace (regular expression, string to search for, substituted string): This function is used to find the seed in the regular expression to search for a rich, if found, replaced with a replacement string;

Single-line function----numeric function

Round (column name | expression, N): This function rounds the column name or the value represented by the expression to the decimal point n bit;

Trunc (column name | expression, N): This function takes the column name or the value represented by the expression to n digits after the decimal point;

Mod (m,n): This function divides m by N and takes the remainder

Related Article

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.