Skip to content

Commit c2a3d51

Browse files
bluestreak01claude
andcommitted
fix(aggregation): remove outdated nested aggregates limitation note
QuestDB now supports using aggregate functions as arguments to other functions, so this warning is no longer accurate. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 03fc974 commit c2a3d51

1 file changed

Lines changed: 0 additions & 24 deletions

File tree

documentation/query/functions/aggregation.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -126,30 +126,6 @@ is documented in each function's description.
126126

127127
:::
128128

129-
:::note Nested aggregates not supported
130-
131-
QuestDB does not support using aggregate functions as arguments to other
132-
functions. For example, this is not allowed:
133-
134-
```questdb-sql
135-
SELECT datediff('d', min(timestamp), max(timestamp)) FROM trades;
136-
```
137-
138-
Running it will result in the following error:
139-
140-
`Aggregate function cannot be passed as an argument`
141-
142-
You can work around this limitation by using CTEs or subqueries:
143-
144-
```questdb-sql title="CTE workaround"
145-
WITH minmax AS (
146-
SELECT min(timestamp) AS min_date, max(timestamp) AS max_date FROM trades
147-
)
148-
SELECT datediff('d', min_date, max_date) FROM minmax;
149-
```
150-
151-
:::
152-
153129
---
154130

155131
## approx_count_distinct

0 commit comments

Comments
 (0)