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