八月 31, 2017 4:27:58 下午 org.apache.catalina.core.StandardWrapperValve invoke
嚴重: Servlet.service() for servlet [action] in context with path [/fpgl] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: java.sql.SQLException: ORA-00936: missing expression
### The error may exist in file [D:\qiming\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\fpgl\WEB-INF\classes\com\faw_qm\vrr\dao\impl\common\fpgl\DifferentDao.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select * from ( select t.* ,to_char(time,'MM')||'月' as month , from t_fpgl_inputinfo t )order by month
### Cause: java.sql.SQLException: ORA-00936: missing expression
; bad SQL grammar []; nested exception is java.sql.SQLException: ORA-00936: missing expression
] with root cause
java.sql.SQLException: ORA-00936: missing expression
uj5u.com熱心網友回復:
樓主還是表達清楚些吧,真心看不懂
uj5u.com熱心網友回復:
select t.* ,to_char(time,'MM')||'月' as month , from t_fpgl_inputinfo tas month 后面多了一個逗號
uj5u.com熱心網友回復:
我要查詢一段個 時間段內的 資料 并且 把 DATE型別的時間 只顯示月份 運行后后臺報錯 運算式缺失uj5u.com熱心網友回復:
樓主的sql陳述句可能有問題,把拼接完的陳述句貼上來看看SELECT *
FROM ( SELECT t.* ,
to_char(TIME, 'MM') AS month
FROM t_fpgl_inputinfo t
) tt
ORDER BY MONTH
uj5u.com熱心網友回復:
我想通要取 時間段內的資料 并按月份顯示<select id="query" resultMap="DifferentResult">
select * from
(
select t.* ,to_char(time,'MM')||'月' as month
from t_fpgl_inputinfo t
<where>
<if test="startTime != null and startTime != ''">
and to_char(time,'YYYY-MM-DD') >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and to_char(time,'YYYY-MM-DD') <= #{endTime}
</if>
</where>
)order by month
</select>
uj5u.com熱心網友回復:
這個 方法 應該沒有問題 另一個用例中 使用的就好使select id="query" resultMap="ZRCJheadResult">
select * from
(
select z.* ,to_char(wl_date,'MM')||'月' as wl_month ,wl_weight*nf_num as nf_tonnage ,wl_weight*wf_num as wf_tonnage ,wl_weight*nt_num as nt_tonnage ,wl_weight*wt_num as wt_tonnage
,wl_weight*dd_num as dd_tonnage ,wl_weight*fj_num as fj_tonnage ,round(nf_num/dd_num,2) as nf_rate ,round(wf_num/fj_num,2) as wf_rate ,round(nt_num/dd_num,2) as nt_rate ,round(wt_num/fj_num,2) as wt_rate
,round((wf_num+wt_num)/fj_num,2) as wtwf_rate ,round((nf_num+wf_num/dd_num),2) as nwf_rate
from ZRCJ z
<where>
<if test="startTime != null and startTime != ''">
and to_char(wl_date,'YYYY-MM-DD') >= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and to_char(wl_date,'YYYY-MM-DD') <= #{endTime}
</if>
</where>
)order by wl_month
</select>
uj5u.com熱心網友回復:
這個是SQL Server的陳述句?第一次見耶,還可以這樣寫?怎么看著有點像h5啊
uj5u.com熱心網友回復:
這是用的ORACLE,你換個板塊吧。
uj5u.com熱心網友回復:
添加別名了嗎?uj5u.com熱心網友回復:
2樓不是已經給出答案了嗎uj5u.com熱心網友回復:
select t.* ,to_char(time,'MM')||'月' as month , from t_fpgl_inputinfo t
改成:
select t.* ,to_char(time,'MM')||'月' as month from t_fpgl_inputinfo t
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/81493.html
標籤:基礎和管理
下一篇:哪位大神幫忙分析下
