Re: Subquery to select max(date) value

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Subquery to select max(date) value
Дата
Msg-id CAKFQuwaSCp-0EQAhFecEG2meTBA=sbKZ2_9qFxhbG4SPiroSrQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Subquery to select max(date) value  (Ken Tanzer <ken.tanzer@gmail.com>)
Ответы Re: Subquery to select max(date) value
Список pgsql-general
On Thu, Mar 28, 2019 at 4:05 PM Ken Tanzer <ken.tanzer@gmail.com> wrote:

 (And I don't think the one inside the lateral join is doing you any good).  Try:

...
              a.next_contact is not null
             limit 1) sq
            order by sq.next_contact DESC;


The fact that the subquery has a LIMT 1 clause leads me to assume the ORDER BY there is quite necessary.

David J.

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Subquery to select max(date) value
Следующее
От: Ken Tanzer
Дата:
Сообщение: Re: Subquery to select max(date) value