last-agg
v1.0.0
Published
last non null data agreggate function for postgres
Downloads
14
Maintainers
Readme
unique-agg
last non null data agreggate function for postgres
Case of use
You want to repeat the value of some field if the next row has a null
.
id |country | city ---|----------|------ 1 | | Base Antártica 2 |Argentina | Buenos Aires 3 | | Córdoba 4 | | Rosario 5 |Uruguay | Montevideo
select id, last_agg(country) over (order by id), city
from cities
order by id;
id |country | city ---|----------|------ 1 | | Base Antártica 2 |Argentina | Buenos Aires 3 |Argentina | Córdoba 4 |Argentina | Rosario 5 |Uruguay | Montevideo
Install
psql < bin/create_last_agg.sql