Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3
Hi,
I try to create some basis SQL statements with the createQuery method.
-------- code --------------
Query countQuery = HibernateUtil.currentSession()
.createQuery("select count(*) from (select s.id as id, s.code as code, s.name as name from Service s) as tblCount");
------- Error ---------------
countQuery: select count(*) from (select s.id as id, s.code as code, s.name as name from Service s) as tblCount
11-nov-2005 21:28:55 org.hibernate.hql.ast.ErrorCounter reportError
SEVERE: *** ERROR: line 1:22: unexpected token: (
------ Test in MySQL -------
query: select count(*) from (select s.id as id, s.code as code, s.name as name from Service s) tblCount;
!!!! Same query except I remove the " as " for my table name
result: count(*) = 6
You see the query works in MySQL but not with the HSQL, somebody know where i'm wrong.
Thx in adv,
Pieter Pareit