Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql ORACLE中2015年12月5日03.48.57.061000000 PM的日期时间格式_Sql_Oracle_Oracle10g_Oracle Sqldeveloper - Fatal编程技术网

Sql ORACLE中2015年12月5日03.48.57.061000000 PM的日期时间格式

Sql ORACLE中2015年12月5日03.48.57.061000000 PM的日期时间格式,sql,oracle,oracle10g,oracle-sqldeveloper,Sql,Oracle,Oracle10g,Oracle Sqldeveloper,我在我们的一个表中有时间戳(05-DEC-15 03.48.57.061000000 PM)。我想比较这个时间戳来检索数据。我写了下面的问题 select * from ACTIVATIONRECORDS WHERE ACTIVATIONDATE = TO_DATE('04-12-15 03.48.57.052000000 PM','DD-MM-YY HH.MI.SS.SSSSS PM'); 但它的失败伴随着以下错误 ORA-01861: literal does no

我在我们的一个表中有时间戳(
05-DEC-15 03.48.57.061000000 PM
)。我想比较这个时间戳来检索数据。我写了下面的问题

select * from ACTIVATIONRECORDS
WHERE ACTIVATIONDATE =
            TO_DATE('04-12-15 03.48.57.052000000 PM','DD-MM-YY HH.MI.SS.SSSSS PM');
但它的失败伴随着以下错误

ORA-01861: literal does not match format string
01861. 00000 -  "literal does not match format string"
*Cause:    Literals in the input must be the same length as literals in
           the format string (with the exception of leading whitespace).  If the
           "FX" modifier has been toggled on, the literal must match exactly,
           with no extra whitespace.
*Action:   Correct the format string to match the literal.

数据类型
DATE
不提供任何小数秒,因此格式不起作用。改用
时间戳

分数秒由
FF
表示,而不是
sss

然后,您应该使用四位数字表示年份,或者使用
RR
而不是
YY

您应该使用
x
表示“本地基数字符”,而不是硬编码的点

这一个有效:

TO_TIMESTAMP('04-12-15 03.48.57.052000000 PM','DD-MM-RR HH.MI.SSxFF PM')

数据类型
DATE
不提供任何小数秒,因此格式不起作用。改用
时间戳

分数秒由
FF
表示,而不是
sss

然后,您应该使用四位数字表示年份,或者使用
RR
而不是
YY

您应该使用
x
表示“本地基数字符”,而不是硬编码的点

这一个有效:

TO_TIMESTAMP('04-12-15 03.48.57.052000000 PM','DD-MM-RR HH.MI.SSxFF PM')
请注意,“SSSSS”持续时间为午夜后几秒(0-86399)

请注意,“SSSSS”持续时间为午夜后几秒(0-86399)

截止日期('04-12-15 03.48.57.052000000 PM','DD-MM-YY HH.MI.SS.ssss PM');?截至日期('04-12-15 03.48.57.052000000 PM','DD-MM-YY HH.MI.SS.sssss PM')的可能副本;?可能重复的