Re: SQL Question

Поиск
Список
Период
Сортировка
От Stephen Clouse
Тема Re: SQL Question
Дата
Msg-id 5d0ee2170601091542s6d59526agfa89137793151245@mail.gmail.com
обсуждение исходный текст
Ответ на SQL Question  (<operationsengineer1@yahoo.com>)
Ответы Re: SQL Question  (<operationsengineer1@yahoo.com>)
Список pgsql-novice
On 1/6/06, operationsengineer1@yahoo.com <operationsengineer1@yahoo.com> wrote:
and another sql question...

greatly simplified info:

t_sn
sn_id
sn

t_inspect
inspect_id
sn_id (fkey)
inspect_pass (boolean)

i want to display all sns where there is not a single
instance of inspect_pass = t

This should get you what you're looking for:

SELECT sn FROM t_sn
WHERE sn_id NOT IN
    (SELECT sn_id FROM t_inspect
     WHERE inspect_pass = t)

--
Stephen Clouse <stephenclouse@gmail.com>

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

Предыдущее
От:
Дата:
Сообщение: Re: SQL Question
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: database ->xml