Oracle+mybatis sql报ORA-00923: 未找到要求的 FROM 关键字
<![CDATA[selecttruncto_char(ordoprtime,'hh24')periodtime,max(consumingtime)maxcosttim...
<![CDATA[
select trunc to_char(ordoprtime, 'hh24') periodtime,
max(consumingtime) maxcosttime,
min(consumingtime) mincosttime,
avg(consumingtime) costtime
from sync_cooperator
where ordoprtime between sysdate - 200 and sysdate
and business = '00'
and status = '01'
group by trunc to_char(ordoprtime, 'hh24');
]]>
----------------------------------------------------------------------------------------------
控制台报:
Cause: java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字
; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字
] with root cause
java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:813)
我是刚入行的菜鸟,请问各位大神,这里那里有异常请指教. 展开
select trunc to_char(ordoprtime, 'hh24') periodtime,
max(consumingtime) maxcosttime,
min(consumingtime) mincosttime,
avg(consumingtime) costtime
from sync_cooperator
where ordoprtime between sysdate - 200 and sysdate
and business = '00'
and status = '01'
group by trunc to_char(ordoprtime, 'hh24');
]]>
----------------------------------------------------------------------------------------------
控制台报:
Cause: java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字
; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字
] with root cause
java.sql.SQLException: ORA-00923: 未找到要求的 FROM 关键字
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:219)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:813)
我是刚入行的菜鸟,请问各位大神,这里那里有异常请指教. 展开
展开全部
select trunc(to_char(ordoprtime, 'hh24')) periodtime, --这个地方
max(consumingtime) maxcosttime,
min(consumingtime) mincosttime,
avg(consumingtime) costtime
from sync_cooperator
where ordoprtime between sysdate - 200 and sysdate
and business = '00'
and status = '01'
group by trunc(to_char(ordoprtime, 'hh24')); --这个地方
上边标注的2个地方,自己看看差在哪里吧,这些东西你先在oracle里执行无误了再放到代码里,别sql还没运行成功就扔进去
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询