File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Avg(...) aggregate function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Avg(...) aggregate function" Watch "Avg(...) aggregate function" New topic
Author

Avg(...) aggregate function

subhashchandra medhiassam
Ranch Hand

Joined: Sep 10, 2008
Posts: 72
Dear friends,
I would like to know how to use the avg(...) aggregate function available in hibernate. Kindly help me with some simple example.

Thanks in advance,
Subhash
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
select avg(e.salary) from Employee e
subhashchandra medhiassam
Ranch Hand

Joined: Sep 10, 2008
Posts: 72
Thanks. But i would like to know how to execute the query and retrieve the result of the avg(...) function. Kindly help.

Subhash
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Here is the best place to start. Have a read of the chapter on Querying.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Avg(...) aggregate function