Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkAol-0004UF-Ud for pgsql-general@arkaria.postgresql.org; Thu, 17 Jan 2019 16:47:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gkAok-0002lA-7l for pgsql-general@arkaria.postgresql.org; Thu, 17 Jan 2019 16:46:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkAoj-0002ch-Rp for pgsql-general@lists.postgresql.org; Thu, 17 Jan 2019 16:46:58 +0000 Received: from mail.appl-ecosys.com ([50.126.108.78]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gkAoh-00031g-7v for pgsql-general@lists.postgresql.org; Thu, 17 Jan 2019 16:46:56 +0000 Received: from salmo.appl-ecosys.com (salmo.appl-ecosys.com [192.168.55.1]) by mail.appl-ecosys.com (Postfix) with ESMTP id 0CF4499353 for ; Thu, 17 Jan 2019 08:46:54 -0800 (PST) Date: Thu, 17 Jan 2019 08:46:54 -0800 (PST) From: Rich Shepard To: "pgsql-generallists.postgresql.org" Subject: Re: Refining query statement In-Reply-To: Message-ID: References: <9a5976c8-76da-f06d-9840-5dcf8723e38b@gmx.net> User-Agent: Alpine 2.20 (LNX 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 17 Jan 2019, David G. Johnston wrote: > Why is next_contact allowed to be null? David, There are a number of reasons. The prospect might have retired, told me to pound sand, or has put off a decision. > 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?) That's quite true. I realize I've been asking the question incorrectly. What I want is a list of contacts to make today. This includes ones that should have been made earlier but weren't and excludes earlier contacts that have no scheduled next contact (therefore, the nulls.). Does this clarify what I'm asking of the data? Thanks, Rich