Re: Suggestion. Optional local ORDER BY clause for DISTINCT ON

2023-10-10 Thread Tom Lane
Stefan Stefanov writes: > Gents, I have a suggestion for DISTINCT ON clause syntax. >DISTINCT ON (expression(s) [ORDER BY expression(s)]) > Determines the precedence within each DISTINCT ON group (i.e. the ‘first’ row > to be picked) > Motivation > • Using the query-wide ORDER BY clause to

Suggestion. Optional local ORDER BY clause for DISTINCT ON

2023-10-10 Thread Stefan Stefanov
Gents, I have a suggestion for DISTINCT ON clause syntax. DISTINCT ON (expression(s) [ORDER BY expression(s)]) Determines the precedence within each DISTINCT ON group (i.e. the ‘first’ row to be picked) Motivation • Using the query-wide ORDER BY clause to determine which record to pick m