Re: Subquery to select max(date) value

Поиск
Список
Период
Сортировка
От Ken Tanzer
Тема Re: Subquery to select max(date) value
Дата
Msg-id CAD3a31US2nNsY5jhasTMDHixK3WQJnnCi_2hyQY5vsgUGsOaTw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Subquery to select max(date) value  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Subquery to select max(date) value
Список pgsql-general


On Thu, Mar 28, 2019 at 4:14 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Thu, 28 Mar 2019, Ken Tanzer wrote:

> You need the ORDER BY in the outer join.

Ken,

I thought so. But, ...

> (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;

This re-orders the returned set, but still not in chronological order.

Really?  Is your next_contact field a date field and not a text field?  What order does it come out in?

(And I assume you saw David J's correction to the misinformation I offered.)

Cheers,
Ken
 

--
AGENCY Software  
A Free Software data system
By and for non-profits
(253) 245-3801

learn more about AGENCY or
follow the discussion.

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

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