The HAVING clause applies a query filter on the result of the GROUP BY clause. A HAVING clause always uses the aggregate, which is calculated using the unmasked value of a DDM-configured field, irrespective of your DDM privileges.

Example

The following example illustrates the use of HAVING clause with a DDM-configured field.
SELECT State, COUNT(*) from pub.Customer GROUP BY State
HAVING COUNT(*) > 25
In this example, State is a DDM-configured field. The SQL engine processes the HAVING clause, which uses the aggregate calculated from the unmasked value of State, regardless of your DDM privileges. However, the SELECT list of the query returns unmasked values of State for authorized users and masked values for unauthorized users.