Re: dumb question

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
Cc: Felipe Santos <felipepts(at)gmail(dot)com>, Steve Clark <steve(dot)clark(at)netwolves(dot)com>, pgsql <pgsql-general(at)postgresql(dot)org>
Subject: Re: dumb question
Date: 2016-06-02 17:58:47
Message-ID: CAKFQuwZeDWL1xp8oab1rXHKoXpbMOaYbfheRKsOZ=LdjcjRdgw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 2, 2016 at 1:48 PM, Steve Crawford <
scrawford(at)pinpointresearch(dot)com> wrote:

> On Thu, Jun 2, 2016 at 10:40 AM, Felipe Santos <felipepts(at)gmail(dot)com>
> wrote:
>
>> I think sts=0 means ref_id is null
>>
>> So, what I think he wants to achieve is:
>>
>> select max(id) from yourtable where sts=0 and id not in (select ref_id
>> from yourtable);
>>
>> Isn't it?
>>
>> The OP will need to explain further as we are all guessing. As I
> mentioned in my earlier (accidental top - curses GMail) post, table
> structures and the query or queries that don't work would be useful. So
> would a description of the problem that is being solved since there could
> be better approaches.
>
>
​Maybe we mis-interpreted but as written this is the solution. My out-loud
thinking was a more verbose version of this.​

​David J.​

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message rverghese 2016-06-02 18:01:36 Partitioned tables do not return affected row counts to client
Previous Message Steve Crawford 2016-06-02 17:48:50 Re: dumb question