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