Oracle common functions

xiaoxiao2021-03-06  74

String: Concat (Char1, Char2); Returns the results connected to Charl and Char2.

INITCAP (Char): turn the first letter of each word in char to uppercase and returns.

Lower / Upper (Char); turn all letters of char to small / uppercase and return

LPAD (Charl.n, [Char2]) / RPAD (CHAR1, N [, Char2]): Plus the Char2 character sequence in the left / right side of Charl until the newly generated string total length is N, then return to new String, the default value of char2 is a single space

Ltrim (char [, set]): Remove the letters belonging to the set character set from the left / right side of Char until the first one does not belong to the character, returns a new string. The set default is space.

Replace (CHAR, Search_String]): Use replacement_string to replace all strings Search_String in Char, if Replacement_String is omitted, remove all Search_String.

Substr (Char, M [, N]): From the first m characters of char to take n characters, constitute a substring of char and return

Length (char): Returns the length of the string

date:

Add_MONTHS (D, N): Calculate the date D plus N month date and return

Last_Day (d): Returns the date corresponding to the last day of the month of the date D

MONTHS_BETWEEN (D1, D2): The number of months between the calculation d1 and d2

D1 later than D2,

D1 earlier than D2,

Equal, return to an integer

Trunc (D, [FMT]): Cut the date D and return it according to the unit specified in the format mode FMT.

Numerical:

Trunc (N [, M]): Returns the n value truncated in the M bit, when M omit is omitted, at the 0-bit truncation, when the M is negative, cutting the left M digits of the decimal point.

Conversion function:

TO_CHAR (D [, FMT [, 'NLSPARAMS']]: Convert D by the date type value into a VARCHAR2 type according to the date format specified by the FMT

The date format specified by FMT should be enclosed in single quotes.

TO_DATE (CHAR [, FMT [, 'NLSPARAMS']]): Convert CHAR by the CHAR or VARCHAR2 type to date type value according to the date format specified by FMT

TO_NUMBER (CHAR [, FMT, ['NLSPARAMS]]: Convert Char by CHAR type or varchar2 type to numeric type data

Miscellaneous function:

Dump (expr, [, return_format [, start_position [, length]]:

GreateSt (expr [, expr] *) / Least: Returns the maximum / small value in all EXPR expressions. Quask in the type of the first expression

NVL (Expr1, Expr2): If the value of expression expr1 is empty, return the value of Express EXPR2, if expression expr1 is not empty, return the value of the value of the expression EXPR1

Count (<* | [DISTINCT | All] expr>)

MIN ([Distinct | All] EXPR)

Max ([DISTINCT | All] EXPR)

AVG ([Distinct | all] n)

SUM ([Distinct | All] n)

转载请注明原文地址:https://www.9cbs.com/read-93020.html

New Post(0)