First you must create these aggregate functions:
https://wiki.postgresql.org/wiki/First/last_(aggregate)

пт, 3 янв. 2020 г. в 18:11, Cédric Krier <python-sql@tryton.org>:

Cédric Krier <cedric.krier@b2ck.com> added the comment:

> but is supported by any version of PostgreSQL.

For me, it is not supported by PostgreSQL:

trunk=# select last(id) from party_party;
ERROR:  function last(integer) does not exist
LINE 1: select last(id) from party_party;
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

__________________________________________
python-sql tracker <python-sql@tryton.org>
<https://python-sql.tryton.org/bug65>
__________________________________________