1.0.0 • Published 8 years ago

last-agg v1.0.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
8 years ago

unique-agg

last non null data agreggate function for postgres

language: English also available in: Spanish

Case of use

You want to repeat the value of some field if the next row has a null.

idcountrycity
1Base Antártica
2ArgentinaBuenos Aires
3Córdoba
4Rosario
5UruguayMontevideo
select id, last_agg(country) over (order by id), city
   from cities
   order by id;
idcountrycity
1Base Antártica
2ArgentinaBuenos Aires
3ArgentinaCórdoba
4ArgentinaRosario
5UruguayMontevideo

Install

psql < bin/create_last_agg.sql

License

MIT

1.0.0

8 years ago