...
There can be multiple OVER
clauses in a single query. A singe single OVER
clause only applies to the immediately preceding function call:
Code Block | ||
---|---|---|
| ||
SELECT
a,
COUNT(b) OVER (PARTITION BY c),
SUM(b) OVER (PARTITION BY c)
FROM T; |
...
Code Block | ||
---|---|---|
| ||
SELECT a,
COUNT(b) OVER (PARTITION BY c) AS b_count,
SUM(b) OVER (PARTITION BY c) AS b_sum
FROM T; |
WINDOW clause
...