Ⅰ hibernate中,用HQL查询如何获取数据库中年龄字段最大的那条记录HQL语句怎么写

可以用子查询:

hql语句

"from User where age=(select max(age) from User) "

相应的sql语句是

SELECT * FROM USER WHERE AGE=(SELECT MAX(AGE) FROM USER);