Re: dumb question

Поиск
Список
Период
Сортировка
От John R Pierce
Тема Re: dumb question
Дата
Msg-id ffe78c2a-5e1e-6ee7-f8c3-ce634b2f9452@hogranch.com
обсуждение исходный текст
Ответ на Re: dumb question  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: dumb question  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On 6/2/2016 11:10 AM, Steve Clark wrote:
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);


do note, this is whats known as an 'anti-join', and these can be pretty expensive on large tables.  



-- 
john r pierce, recycling bits in santa cruz

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

Предыдущее
От: Dann Corbit
Дата:
Сообщение: Re: dumb question
Следующее
От: Dann Corbit
Дата:
Сообщение: Re: dumb question