select a.time,a.node_id,count(node_id) as times from temperature a ,设备管理表 b where a.NODE_ID = b.注册标签号
and a.time between to_date('2010-09-27 00:00:00','yyyy-MM-dd hh24:mi:ss') and
to_date('2010-09-27 23:59:59','yyyy-mm-dd hh24:mi:ss')group by a.time,a.node_id加上时间查询条件便出错了以下是错误信息:
Error report:
SQL Error: 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.
and a.time between to_date('2010-09-27 00:00:00','yyyy-MM-dd hh24:mi:ss') and
to_date('2010-09-27 23:59:59','yyyy-mm-dd hh24:mi:ss')group by a.time,a.node_id加上时间查询条件便出错了以下是错误信息:
Error report:
SQL Error: 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.
Error starting at line 1 in command:
select a.time,a.node_id,count(a.node_id) as times from temperature a ,设备管理表 b where a.NODE_ID = b.注册标签号
and a.time between to_date('2010-09-27 00:00:00','yyyy-MM-dd hh24:mi:ss') and
to_date('2010-09-27 23:59:59','yyyy-MM-dd hh24:mi:ss')group by a.time,a.node_id
Error report:
SQL Error: 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.改成 count(a.node_id) 出同样错误。
看来出错在此处了 是别人建的表 搞不懂'2010-09-27 23:59:59' 格式 为什么要用varchar2类型?
select a.time,a.node_id,count(a.node_id) as times from temperature a ,设备管理表 b where a.NODE_ID = b.注册标签号
and a.time between to_date('2010-09-27 00:00:00','yyyy-MM-dd hh24:mi:ss') and
to_date('2010-09-27 23:59:59','yyyy-mm-dd hh24:mi:ss')group by a.time,a.node_id