In Oracle, you can use the "to_char()" function in conjunction with the select statement to set the date format of the query. The select statement is used to query data, and the "to_char()" function is used to set the date format. The syntax is: "select to_char(date data column,'date format') from ...".
The operating environment of this tutorial: Windows 10 system, Oracle version 12c, Dell G3 computer.
Use the to_char() function to set the query date format.
The syntax is:
to_char(日期,"转换格式" )
Examples are as follows:
Original format:
select Starttime,Endtime from ELEARNING.Opt_Training where Orgid = '6c457da0-7825-4df7-bcd7-0e0e9c37631b';
Query results:
Query format: to_char() function, return yyyy/MM/dd:
select to_char(Starttime,'yyyy/MM/dd'),to_char(Endtime,'yyyy/MM/dd') from ELEARNING.Opt_Training where Orgid = '6c457da0-7825-4df7-bcd7-0e0e9c37631b';
Query results:
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of How to set the query date format in oracle. For more information, please follow other related articles on the PHP Chinese website!