Re: Refining query statement

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Refining query statement
Дата
Msg-id CAKFQuwZFgogSc1Td0hXz7Jtzn3YvFisDEnPL6+3NLO1O7hsnkA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Refining query statement  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Refining query statement
Список pgsql-general
On Thu, Jan 17, 2019 at 9:14 AM Rich Shepard <rshepard@appl-ecosys.com> wrote:
> ORDER BY c.contact_id, a.next_contact DESC;

> The WHERE clause needs to exclude a contact_id where the most current row in
> Activities has NULL for the next_contact column.

Why is next_contact allowed to be null?

Your concept of "most current row" is strictly based upon next_contact
so if next_contact is null it is impossible to know whether it is the
most current row (consider that two activities could be missing the
next_contact date - which of those is the most current?)

David J.


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