Hibernate version: 2.1
Name and version of the database you are using: Mysql 4.0.12
I'm trying to run the following query:
Code:
select left(business.name,1) count(business.name) from com.company.product.module.business.model.Business business where business.approved = 1 group by left(business.name,1) order by business.name
and this fails complaining about 'undefined alias'.
When I change the
Code:
select left(business.name, 1)
to
Code:
select business.name
it works even though
Code:
group by left(business.name,1)
remains.
Full stack trace of any exception that occurs:
Unable to retrieve business alphabet: undefined alias: left [select left(business.name,1) count(business.name) from com.company.product.module.business.model.Business business where business.approved = 1 group by left(business.name,1) order by business.name ]
Thanks in advance,
Cagan