derby « MySQL « JPA Q&A





1. max() in subselect with Hibernate and Derby/MySQL    forum.hibernate.org

Hi, I'm having trouble with how to apply the max() function to the result of a select. Right now my code looks like this: session.beginTransaction(); Query hqlQuery = session .createQuery("select m.nom, sum(s.quantite)" + " from Puzzle p, Magasin m, Stock s" + " where p.pieces between "+min+" and "+max + " and p.id = s.idJouet and m.id = s.idMagasin" + " ...