Views: Group By & Aggregate

Views: Group-By and Aggregate

Views can be used to expose the results of a custom query as a virtual table.

Sometimes we might want to fetch some data derived by aggregating (avg, min, max, etc.) over a group of rows in a table.

This view will fetch the average article rating for each author across two tables.

ERD Diagram


  • This schema is installable through your Hasura Console
  • The schema sharing source code is available: https://github.com/hasura/schema-sharing/tree/main/postgres/views-group-aggregate
  • The schema sharing source code was derived from the following tutorial: https://hasura.io/docs/latest/graphql/core/databases/postgres/schema/views.html#example-group-by-and-then-aggregate
Released: June 16, 2021
Developed by: Hasura
Category: Core Concepts

We’d love to connect with you at one of our many global events.

Event
HasuraCon 2021HasuraCon 2021Community call
Ready to get started?
Start for free on Hasura Cloud or you could contact our sales team for a detailed walk-through on how Hasura may benefit your business.
Get monthly product updates
Sign up for full access to our product and community highlights, new features, and occasional baby animal gifs! Oh, and we have a strict no-spam rule. ✌️