Re: Selecting table row with latest date

Поиск
Список
Период
Сортировка
От Francisco Olarte
Тема Re: Selecting table row with latest date
Дата
Msg-id CA+bJJbx2kV=nDNB9zxBhMzgNaYLH-4nCh98y7boH-vkYCaUPeA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Selecting table row with latest date  (Rich Shepard <rshepard@appl-ecosys.com>)
Ответы Re: Selecting table row with latest date  (Rich Shepard <rshepard@appl-ecosys.com>)
Список pgsql-general
Rich:

On Thu, Aug 19, 2021 at 6:59 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
> On Thu, 19 Aug 2021, Rob Sargent wrote:
> > Yeah, but my quibble is the the table you described up-thread. Your
> > contact table contains next_contact? I think that column should be
> > normalized out.
> Why should I have a separate table with one column: next_contact? The
> next_contact date is associated with a person and the date that person was
> contacted.

Is your next_contact really dependent on the contact record (
person+contact_date? ).

I mean, your tables seem CRM like. You stated next_contact for old
contacts is not interesting. It seems next_contact is associated just
by a person, something like this:

You contact person 1 on april 2, decide to follow up on june 2 =>
insert ( p=1, cd=20210402, nc=20210602 ).

Case 1: You contact it in 20210603 , followup for mid july:
   Insert (1, 20210603, 20210715).
   Is the nc for the previous record useful for anything ? ( It seems
to be nor useful for calling, but you may want to do reports to see
next-contact correlation with the contacts on another records )

Case 2: You contact in mid may ( for whatever reason, he calls you,
whatever, you insert a record for follow up in July ( 1,20210515,
20210715).
Is the next contact date for june still valid?

To me, and maybe others, it seems there is only one valid next-contact
date, potentially null, which should go in the person record, and may
be the contacts table should capture the value of next-contact at the
time the contact was made for analysis. This also makes finding
contacts to be made soon easier.

Of course no separate table for next-contact.

Francisco Olarte.



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: PostgreSQL 9.2 high replication lag
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Selecting table row with latest date