...
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT a, LAG(a, 3, 0) OVER (PARTITION BY b ORDER BY C) FROM T; |
Distinct counting for each partition
...
SELECT a, COUNT(distinct a) OVER (PARTITION BY b)
FROM T;
...
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT a, LAG(a, 3, 0) OVER (PARTITION BY b ORDER BY C) FROM T; |
...
SELECT a, COUNT(distinct a) OVER (PARTITION BY b)
FROM T;