Introduction To Aggregrate Function
In this section, you will understand about the Hibernate aggregrate function. First of all we will going to explain what is aggregrate function. Aggregrate function is a function that provides you a single value.
Aggregrate Function: Hibernate also support HQL (Hibernate Query Language). SQL provides you aggregrate functions like: count('column_name'), sum('column_name'), avg('column_name'), min('column_name') and max('column_name'). Similarly, hibernate provides you the following aggregrate functions:
1. COUNT(propery_name or *): How many number of times a property is comming.
2. COUNT(DISTINCT propery_name): How many number of times a different property value is comming.
3. SUM(propery_name): It calculates the sum total of given proerty value.
4. AVG(propery_name): It calculates the average of given value of property.
5. MIN(propery_name): It gives the mimimum value of given property value
6. MAX(propery_name): It gives the maximum value of given property value.
All above aggregrate functions provide you a single numric result.