HAVING( groupdataset, expression [, UNORDERED | ORDERED( bool ) ] [, STABLE | UNSTABLE ] [, PARALLEL [ ( numthreads ) ] ] [, ALGORITHM( name ) ] )
groupdataset | The name of a GROUPed record set. |
expression | The logical expression by which to filter the groups. |
UNORDERED | Optional. Specifies the output record order is not significant. |
ORDERED | Specifies the significance of the output record order. |
bool | When False, specifies the output record order is not significant. When True, specifies the default output record order. |
STABLE | Optional. Specifies the input record order is significant. |
UNSTABLE | Optional. Specifies the input record order is not significant. |
PARALLEL | Optional. Try to evaluate this activity in parallel. |
numthreads | Optional. Try to evaluate this activity using numthreads threads. |
ALGORITHM | Optional. Override the algorithm used for this activity. |
name | The algorithm to use for this activity. Must be from the list of supported algorithms for the SORT function's STABLE and UNSTABLE options. |
Return: | HAVING returns a GROUPed record set. |
The HAVING function returns a GROUPed record set containing just those groups for which the expression is true. This is similar to the HAVING clause in SQL.
Example:
MyGroups := GROUP(SORT(Person,lastname),lastname); //group by last name Filtered := HAVING(MyGroups,COUNT(ROWS(LEFT)) > 10); //filter out the small groups
See Also: GROUP