如何在oracle中将日期(字符串类型)转换为日期(日期时间) [英] How to convert date(string type) into date(date time ) in oracle
问题描述
我被 Oracle 查询困住了.在我的仪表板应用程序中,我们基本上必须显示总详细信息行的摘要图.在一个特定选项卡中,我们需要详细信息中的日期时间,但我们仅按日期对摘要进行分组.
I am stuck with a Oracle query. In my dashboard app, we have to show a summary graph for total of details lines basically. In one particular tab, we need the datetime in the details, but we group on the summary by date only.
如何在oracle中将日期(字符串类型)转换为日期(日期时间).我在选择中使用选择,换句话说就是嵌套选择.内部查询返回字符串日期时间,外部查询无法将其转换为日期时间
How to convert date(string type) into date(date time ) in oracle. I am using select within select in other words nested select. Inner query returns string date time, and outer query unable to convert this to date time
推荐答案
您可以使用 to_date
函数将字符串转换为日期.例如
You would use the to_date
function to convert a string to a date. For example
to_date( '2012-12-25 13:45:56', 'yyyy-mm-dd hh24:mi:ss' )
或
to_date( '12/25/98', 'MM/DD/RR' )
作为第二个参数传入的格式掩码将取决于字符串的格式.to_date 函数的有效格式掩码集 在文档中.
The format mask that you pass in as the second argument will depend on the format of the string. The set of valid format masks for the to_date function is in the documentation.
这篇关于如何在oracle中将日期(字符串类型)转换为日期(日期时间)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!