日期:2014-05-18  浏览次数:20647 次

请教 Hibernate 子查询的错误

FROM Content cnt WHERE cnt.cntId IN (SELECT tti.indicator.content.cntId FROM TaskToIndicator tti WHERE tti.task.id=:taskId) ORDER BY cnt.sortednum


这是一条HQL,我希望给子查询的某一个字段排序,如果在子查询里面加了 order by 的话,则报“缺少右括号”的奇怪错误,网上找过的资料几乎都是“在子查询里有个成立的 WHERE 就行”,但是不成功。

不知道大家有没有什么办法?
hibernate hql sql

------解决方案--------------------
你的数据库应该是oracle。
http://3w1h.iteye.com/blog/1149998