I try to work with a subquery / subselect in HQL (Hibernate), but it does not work and throws an error ...
I want to know if there is an equivalent in HQL for something like this: ("plain" SQL)
select count(Z) from (SELECT SUM(existencia), almacen, oficina, fila from re_tinventarioubicacion where inventorybranchto = 2 GROUP BY almacen, oficina, fila, estante, entrepano, casilla, precioetiqueta) as Z
I tried to "translate" it from SQL to HQL, but it does not work ... it produces the following:
org.hibernate.hql.ast.QuerySyntaxException: unexpected token
Basically, I need to get the number of rows from the received subquery.
Any ideas?
source
share