Re: Functionally dependent columns in SELECT DISTINCT

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Functionally dependent columns in SELECT DISTINCT
Дата
Msg-id CAKFQuwYEtU7doien_XGh58vjRdsJezXp2BQvKdLcyVZQwhLmgg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Functionally dependent columns in SELECT DISTINCT  (Willow Chargin <postgresql@wchargin.com>)
Ответы Re: Functionally dependent columns in SELECT DISTINCT
Список pgsql-general
On Friday, September 13, 2024, Willow Chargin <postgresql@wchargin.com> wrote:
In reality I really do want the ID columns of the
*most recent* items.

Use a window function to rank them and pull out rank=1, or use a lateral subquery to surgically (fetch first 1) retrieve the first row when sorted by recency descending.

David J. 

В списке pgsql-general по дате отправления: