Hibernate Tutorials/
« Previous | 1 | 2 | 3 | Next »
This clause lets Hibernate pull information from the database and group it based on a value of an attribute and, typically, use the result to include an aggregate value. Following is the simple syntax of using GROUP BY clause:

String hql ="SELECT SUM(E.salary), E.firtName FROM Employee E "+
"GROUP BY E.firstName";
Query query =session.createQuery(hql);
List results =query.list();
« Previous | 1 | 2 | 3 | Next »


copyright © 2014 - all rights riserved by javatechnologycenter.com