oracle查询提示未找到from关键字

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/my_name_nb/article/details/76619617

搞了半天  sql语句没有问题但就是报 from关键字找不到  最后发现


时 取别名的时候带了括号()   所以记住取别名不能带括号

展开阅读全文

ORA-00923: 未找到预期 FROM 关键字 的问题,求助

02-15

代码如下:rnpublic List getForumMainList(final long bid, final int firstResult, final int maxResults) rn return getHibernateTemplate().executeFind(new HibernateCallback() rn public Object doInHibernate(Session s) throws HibernateException, SQLException rn String q = "from Forum" + SysUtil.getForumTableID(bid) +rn " forum where forum.boardID = ? and forum.isNew = 1 and forum.delSign = 0 and forum.auditing = 0 order by forum.isTop desc,forum.lastTime desc";rn Query query = s.createQuery(q);rn query.setLong(0, bid);rn query.setFirstResult(firstResult);rn query.setMaxResults(maxResults);rn List list = query.list();rn return list;rnrn rn rn );rn rnrnrn错误信息rn2007-02-15 14:13:58,859 [org.springframework.jdbc.support.SQLStateSQLExceptionTranslator]-[INFO] Translating SQLException with SQLState '42000' and errorCode '923' and message [ORA-00923: 未找到预期 FROM 关键字rn]; SQL was [null] for task [HibernateAccessor]rn2007-02-15 14:13:58,875 [org.apache.struts.action.RequestProcessor]-[WARN] Unhandled Exception thrown: class org.springframework.jdbc.BadSqlGrammarExceptionrn2007-02-15 14:13:58,875 [org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/bbs]]-[INFO] Bad SQL grammar [null] in task 'HibernateAccessor'; nested exception is java.sql.SQLException: ORA-00923: 未找到预期 FROM 关键字rnrnrn请问是什么问题,明天还有一天了就要完成,急啊,帮忙啊各位 论坛

没有更多推荐了,返回首页