Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause

2023-03-13 Thread Ben Clements
ar 2023 at 12:40, Tom Lane wrote: > > > > Ben Clements writes: > > > As shown above, the following calculated column can bring in the city > name, > > > even though the city name isn't in the GROUP BY: > > >max(city) keep (dense_rank first order by

Idea: Add first() and last() aggregate functions to the main release

2023-03-11 Thread Ben Clements
Idea/request for enhancement: Add the first() and last() aggregate functions to the main release (CREATE EXTENSION first_last_agg). Use Case: PostgreSQL equivalent to Oracle's MAX(...) KEEP (DENSE_RANK FIRST/LAST ORDER BY ...) (https://dba.stackexch

Idea: PostgreSQL equivalent to Oracle's KEEP clause

2023-03-06 Thread Ben Clements
I have an idea/request for enhancement to PostgreSQL (I'm new to PostgreSQL and this mailing list). Idea: There's a technique in Oracle SQL that can be used to simplify aggregation queries: *Aggregate on a particular column, but get information from