From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Refining query statement
Date: Tue, 15 Jan 2019 11:31:40 -0700
Message-ID: <641fb2e0-fbaa-c477-e43d-e0bdaef6e19d@gmail.com> (raw)
In-Reply-To: <26851021-69e3-36e4-170d-40ed7219a180@gmail.com>
References: <alpine.LNX.2.20.1901150738320.5845@salmo.appl-ecosys.com>
<9a5976c8-76da-f06d-9840-5dcf8723e38b@gmx.net>
<26851021-69e3-36e4-170d-40ed7219a180@gmail.com>
On 1/15/19 9:02 AM, Ron wrote: select distinct on (C.contact_id)
C.contact_id, C.lname, C.fname, C.direct_phone, O.org_name, A.next_contact
>> from Contacts as C
>> join Organizations as O on C.org_id = O.org_id
>> join Activities as A on C.contact_id = A.contact_id
>> where A.next_contact <= 'today'
>> and A.next_contact > '2018-12-31'
>> order by c.contact_id, a.next_contact DESC;
>
> And I've never liked this method (though I'm old and crotchety)....
>
I suspect I can match your old and crotchety, but jump in, the water is
fine (once you get used to it)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: robjsargent@gmail.com
Subject: Re: Refining query statement
In-Reply-To: <641fb2e0-fbaa-c477-e43d-e0bdaef6e19d@gmail.com>
References: <alpine.LNX.2.20.1901150738320.5845@salmo.appl-ecosys.com> <9a5976c8-76da-f06d-9840-5dcf8723e38b@gmx.net> <26851021-69e3-36e4-170d-40ed7219a180@gmail.com> <641fb2e0-fbaa-c477-e43d-e0bdaef6e19d@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox