By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE FUNCTION
CREATE FUNCTION
CREATE AGGREGATE
DROP TABLE
CREATE TABLE
INSERT 0 10
| id | first_in_series |
|---|---|
| 1 | 1 |
| 2 | 1 |
| 3 | 1 |
| 6 | 6 |
| 7 | 6 |
| 8 | 6 |
| 10 | 10 |
| 23 | 23 |
| 24 | 23 |
| 25 | 23 |
SELECT 10