• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Avg(...) aggregate function

 
subhashchandra medhiassam
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
select avg(e.salary) from Employee e
 
subhashchandra medhiassam
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the best place to start. Have a read of the chapter on Querying.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic