Re: JOIN query not working as expected

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: JOIN query not working as expected
Дата
Msg-id 164.1133881091@sss.pgh.pa.us
обсуждение исходный текст
Ответ на JOIN query not working as expected  (Mario Splivalo <mario.splivalo@mobart.hr>)
Ответы Re: JOIN query not working as expected  (Mario Splivalo <mario.splivalo@mobart.hr>)
Список pgsql-sql
Mario Splivalo <mario.splivalo@mobart.hr> writes:
> Now I want all services which didn't have any messages within certain
> period:
> pulitzer2=# select * from services where id not in (select distinct
> service_id from messages where receiving_time between '2005-10-01' and
> '2005-10-30');
> (0 rows)

> Why is that?

Probably, you've got some NULLs in the messages.service_id column ...
try excluding those from the sub-select.
        regards, tom lane


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

Предыдущее
От: Michael Burke
Дата:
Сообщение: Re: Database with "override" tables
Следующее
От: Mario Splivalo
Дата:
Сообщение: Re: JOIN query not working as expected