Hibernate version: 2.0
This is the exception which I am getting
net.sf.hibernate.QueryException: aggregate function expected before ( in SELECT:
Name and version of the database you are using: MS SQL Server 2000
I am trying to use a query which is something like
select * from Employee
where emp_id = ALL(
select distinct(emp_id) from Employee
as a where a.comp_id = :compId
)
I am using the following code to convert the hibernate query to normal
sql query
Code:
QueryTranslator tl = new QueryTranslator(hql);
tl.compile((SessionFactoryImplementor) session.getSessionFactory(), new HashMap(), true);
sql = tl.getSQLString();
If any one has come across this error please do help me.
W.r.t to the error should I have a aggregate function in the select clause
Regards
Atul