Aggregated rollup in PostgreSQL with avg and sum in different levels?
I have a PostgreSQL query that aggregates data from multiple tables and generates a report. Currently it works perfectly fine and it is quite simple. Here is the query I'm using: SELECT a.name AS account_name, c.name AS campaign_name, ad.name AS…