Creating a continuous aggregate with the WITH NO DATA option
At the
psqlprompt, create the view:Manually refresh the view:
Create a continuous aggregate with a JOIN
In TimescaleDB V2.10 and later, with Postgres v12 or later, you can create a continuous aggregate with a query that also includes a JOIN. For example:
For more information about creating a continuous aggregate with a JOIN, including some additional restrictions, see the about continuous aggregates section.
Query continuous aggregates
When you have created a continuous aggregate and set a refresh policy, you can query the view with a SELECT query. You can only specify a single hypertable in the FROM clause. Including more hypertables, tables, views, or subqueries in your SELECT query is not supported. Additionally, make sure that the hypertable you are querying does not have [row-level-security policies][postgres-rls] enabled.