Re: dumb question - Mailing list pgsql-general

From Steve Clark
Subject Re: dumb question
Date
Msg-id 1464891043993-007-00403884.steve.clark.netwolves.com@sclark66.netwolves.com
Whole thread Raw
In response to Re: dumb question  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general
Thanks all the below seem to do the trick.

On 06/02/2016 01:58 PM, David G. Johnston wrote:
select max(id) from yourtable where sts=0 and id not in (select ref_id from yourtable);

select max(id) from yourtable where sts=0 and id not in (select ref_id from yourtable);

--
Stephen Clark

pgsql-general by date:

Previous
From: Patrick Baker
Date:
Subject: Re: PL/PGSQL + inserts+updates+limit - Postgres 9.3
Next
From: rob stone
Date:
Subject: Re: Partitioned tables do not return affected row counts to client