Mario Splivalo <[EMAIL PROTECTED]> 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

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

Reply via email to