This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes retrive data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "retrive data" Watch "retrive data" New topic
Author

retrive data

madhuchilipi reddy
Greenhorn

Joined: Feb 09, 2007
Posts: 17
i am writing in sql my query is "select max(sid) from Student" this is my query.
how i write same query using HQL
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Its written pretty much the same as you would in SQL:

However, why do you want the max id? I would normally expect an aggregate function to be used on a numeric property, not the primary key?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: retrive data