<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSFetchRequest/havingPredicate",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Data"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFetchRequest(py)havingPredicate"
  },
  "title" : "havingPredicate"
}
-->

# havingPredicate

The predicate used to filter rows being returned by a query containing a GROUP BY directive.

```
var havingPredicate: NSPredicate? { get set }
```

## Discussion

If a `havingPredicate` value is supplied, the predicate will be run after. Specifying a `havingPredicate` requires that [`propertiesToGroupBy`](/documentation/CoreData/NSFetchRequest/propertiesToGroupBy) also be specified.

## See Also

[`NSFetchRequest`](/documentation/CoreData/NSFetchRequest)

A description of search criteria used to retrieve data from a persistent store.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)