...
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT a, LEAD(a) OVER (PARTITION BY b ORDER BY C ROWS BETWEEN CURRENT ROW AND 1 FOLLOWING)
FROM T; |
LAG specifying a lag of 3 rows and default value of 0
Code Block | ||||
---|---|---|---|---|
| ||||
SELECT a, LAG(a, 3, 0) OVER (PARTITION BY b ORDER BY C ROWS 3 PRECEDING)
FROM T; |
Distinct counting for each partition
...