Oracle database, built-in function summary

Source: Internet
Author: User

1. Aggregation function

Count (field)         //number of non-empty lines max (field)            //Get maximum sum (field)              //Sum avg (field)/               /   average min (field)             /   min value

2. Conversion function

To_date ()       string-to-time  format: to_date (String, ' Yyyy-mm-dd hh24:mi:ss ') Example: To_date   (' 1970-1-1 15:31:33 '  ,   ' Yyyy-mm-dd   Hh24:mi:  SS  ') To_char ()     time-to-string format: To_char (a time, ' yyyy-mm-dd ') Example: To_char (Sbirthday, ' Yyyy-mm-dd '   ) cast ()       General conversion function format: CAST (data as data type (length)) Example: Cast (' 123456 ' as char (6)   )                                             //converted from a string to a number

3. Time function

Sysdate//                                                                                         system Current time add_mouthe (time, value)                                                                           //month plus minus last_day ()                                                                                  //Last day of the current month

4. String functions

Length (string or field name)                                                       //Get string    trim (string or field name)                                                         //Get string, remove front and back space before plus L is remove left space   ltrim (), front plus R is remove right space   RTrim () Replace (field name, '  )                                                           //Find and replace (go space) replace (data, ' Find string ',   ' new string ')                        //Replace substr (string, start position)                                                            //intercept field, default intercept to last Substr (string, start position, end position)                                     //default intercept to specified position                                         //If start position <0, calculate position from right start            InStr (Data, ' Find string ')                                           //Find string and return first position, not found return 0

5. Numerical functions

ABS ()/                                                                                             /Get Absolute mod ()                                                                                             //round (value)/////                                                                           /////  By default, rounding round (number, number of digits)//number of digits >0 the number of digits  after the decimal point =0  Rounding, number of digits <0 the   decimal point before rounding ceil () upper bound value                                                                              //greater than or equal to its smallest integer floor () lower value                                                                        //less than equals to his smallest integer trunc () direct intercept integer//                                                        number of digits >0  The number of digits after the decimal point, the number of digits =0 rounding  , the number of digits <0 the   decimal point before rounding

  

6. Replace function

NVL (value, default)                                                 //Replace null value with default value nv12 (field, non-null replacement value, default value)                                    //replace NULL with default value, change non-null to new value decode (field, value 1, replace value 1, value 2, replace value 2 ....) Default value)                 //Match the value of the field and replace the new value

  

Oracle database, built-in function summary

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.