oracle--function

Source: Internet
Author: User
Tags numeric value

Function 1, numeric function (1) ceil (n)

Returns the smallest integer greater than or equal to n

(2) Power (m,n)

Returns the n-th side of M

(3) Trunc (M[,n])

For the M intercept operation, when n is greater than 0 o'clock, the nth bit is intercepted to the right of the decimal point; when n is omitted, the table intercepts the fractional part of M; when N is less than 0 o'clock, the nth bit to the left of the decimal point is intercepted.

2, character function (1) Concat ((CHAR1,CHAR2)

Used for character joins, returns string Char2 string Char1 after concatenated with string

(2) Instr (Char1,char2,[m[,n])

Returns the position of the specified string char2 in Char1, where m represents the starting search position, and N indicates the number of occurrences of the string char2 in the string char1.

(3) Lpad (Char1,n[,char2])

Padding the string to the left of the string char1 char2 its length to n. Returns the n characters to the left of the string char1 if the string char1 length is greater than n

(4) Replace (CHAR1,CHAR2,CHAR3)

Replace the string char2 in string char1 with the string char3

(5) Substr (Char,m[,n])

The substring used to get the string char, M for the starting position of the substring, and n for the length of the substring

(6) Trim ([Leading|trailing|both]char from String)

Truncate character Char from both ends of the string's head and end goods

3. Date function (1) months_between (D1,D2)

Returns the number of months between D1 and D2 two dates

(2) Sysdate

Returns the date and time of the current system

(3) To_char (d,[,fmt][, ' Nlsparam ')

Convert datetime to a string of a specific format

(4) To_date (char[,fmt][, ' Nlsparam ')

Converts a string char that conforms to a specific format to a date

4. Conversion function (1) cast (expr as datatype)

Returns an expression as a specified type

(2) To_char (char) (3) To_number (char[,fmt][, ' Nlsparam ')

Converts a string char that conforms to a specific format to a numeric value

5. Other functions (1) Decode ()

Form: Decode (EXPR,SEARCH1,RESULT1[,SEARCH2,RESULT2,...] [, default])

Description: If search1=expr, returns RESULT1 if search2=expr, returns RESULT2, and so on.

(2) NVL ()

Form: NVL (EXPR1,EXPR2)

Note: If EXPR1 is null, return EXPR2, otherwise return EXPR1

(3) Nvl2 ()

Form: Nvl2 (EXPR1,EXPR2,EXPR3)

Note: If EXPR1 is null, return EXPR3, otherwise return EXPR2

(4) Nullif ()

Form: Nullif (EXPR1,EXPR2)

Description: Returns null if EXPR1 is equal to EXPR2, otherwise returns EXPR1

(5) Greatest ()

Form: Greatest (Expr1,expr2,...)

Description: Returns the maximum value in several expressions

(6) Least ()

Least (EXPR1,EXPR2,...)

Returns the minimum value in several expressions

(7) COALESCE (EXPR1,[,EXPR2][,EXPR3] ...)

Returns the result of the first non-empty expression in a parameter list

oracle--function

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.