# FIRST/LAST aggregate functions in python-sql

**URL:** <https://discuss.tryton.org/t/first-last-aggregate-functions-in-python-sql/2150>\
**Category:** Developer\
**Tags:** python-sql\
**Created:** [January 4, 2020, 6:31pm UTC](https://discuss.tryton.org/t/first-last-aggregate-functions-in-python-sql/2150 "2020-01-04T18:31:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)\
**Post date:** [January 4, 2020, 6:31pm UTC](https://discuss.tryton.org/t/first-last-aggregate-functions-in-python-sql/2150/1 "2020-01-04T18:31:33Z")

</div>

I have offered a patch for adding FIRST/LAST aggregate functions to `python-sql`.  
Unfortunately Tryton community rejected my offer.  
Maybe it will come in handy for someone:  
[https://codereview.tryton.org/258631002/](https://codereview.tryton.org/258631002/)

> **[Tryton / python-sql · GitLab](https://foss.heptapod.net/tryton/python-sql)**
>
> a library to write SQL queries in a pythonic way

---

<div class="post-metadata">

**Author:** ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)\
**Post date:** [January 8, 2020, 2:46pm UTC](https://discuss.tryton.org/t/first-last-aggregate-functions-in-python-sql/2150/2 "2020-01-08T14:46:53Z")

</div>

It would be interesting to make a proposal that implement only the missing standard `order by` clause.

---

<div class="post-metadata">

**Author:** ![bell](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/b/c67d28/32.png) [@bell](https://discuss.tryton.org/u/bell)\
**Post date:** [January 8, 2020, 6:59pm UTC](https://discuss.tryton.org/t/first-last-aggregate-functions-in-python-sql/2150/3 "2020-01-08T18:59:02Z")

</div>

Here you are:  
[https://codereview.tryton.org/272741002/](https://codereview.tryton.org/272741002/)

> **[Tryton / python-sql · GitLab](https://foss.heptapod.net/tryton/python-sql)**
>
> a library to write SQL queries in a pythonic way
