Name an intermediate result and its grain
Instead of filtering, summarising and joining everything at once, define a small intermediate result: one row per customer. Use it as a query source without creating a stored table.
A derived table is SELECT inside FROM. An ordinary CTE names a SELECT result with WITH for one statement. Define the row grain in either form.
- Name an intermediate result and its grain
- A derived table is SELECT inside FROM. An ordinary CTE names a SELECT result with WITH for one statement. Define the row grain in either form.