Hi,
How to get max value record from table in hibernate, advance in thanks
Hi,
How to get max value record from table in hibernate, advance in thanks
You could use a projection:
Criteria criteria = session
.createCriteria(Person.class)
.setProjection(Projections.max("age"));
Integer maxAge = (Integer)criteria.uniqueResult();
Use the max(...)
aggregate function:
select max(cat.weight) from Cat cat