Common functions of Oralce SQL language (iv) Conversion Functions

Source: Internet
Author: User


Common functions of Oralce SQL language (iv) Conversion Functions
A Conversion Function is mainly used to operate on multiple data types. It is used to convert data from one data type to another, common conversion functions include the following two types. TO_CHAR this function mainly converts a date function to a string. In fact, we mainly use it to convert a date in two date conversion modes: TO_Char (date) or to_char (date, 'format _ model') and the latter is more important in actual work. The simpler Conversion Mode of www.2cto.com compared with EXTRACT is as follows:
2. the TO_DATE function converts a string to a value of the date type. The syntax format is as follows: TO_DATE (date, 'format _ model'). Note that the time format must correspond to the date string, otherwise, a conversion error occurs. We need to use this function. The following two types of inserted fields are date-type, when the inserted data is of the string type, another case is time comparison. The example is as follows:


 

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.