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: