HAVING
Filters a group or an aggregate by a search condition. You can only use
HAVING
with the GROUP BY
clause.You can only access fields that:
- Workday has authorized for use with the Workday Report Writer or default areas.
- The current processing Workday account has permission to access.
Syntax
HAVING condition
Aggregation Functions
You can use these aggregation functions in a search condition:
Aggregation Function | Description |
|---|---|
AVG( field ) | Returns the average value of a numeric field. |
COUNT() | Returns the number of instances matching the query criteria. |
COUNT (DISTINCT field ) | Returns the unique number of instances matching the query criteria. Use
only on text and single instance fields. |
MIN( field ) | Returns the minimum value of a field. |
MAX( field ) | Returns the maximum value of a field. |
SUM( field ) | Returns the total sum of a numeric field. |
Example
Return the count of workers by location where the number of workers is greater than 100:
SELECT location, count() as Count_Workers FROM allWorkers GROUP BY location HAVING count() > 100