Skip site navigation (1) Skip section navigation (2)

Re: Weird NOT IN condition in SELECT (PostgreSQL 7.4.3

From: Richard Huxton <dev(at)archonet(dot)com>
To: Ferruccio Zamuner <nonsolosoft(at)diff(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Weird NOT IN condition in SELECT (PostgreSQL 7.4.3
Date: 2004-06-23 14:38:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Ferruccio Zamuner wrote:
> Hi,
> I've following select, and I expect to receive a single record as result 
> from it:
> select
>   from copie as c
>  where c.enum=46857 and
>     c.condizio_prestito = 'A' and
> not in (select id_copia from testi_fermi_prenotati) and
> not in (select id_copia from prestiti);
> but it doesn't give me any records at all.
> Following there is table descriptions:
> CREATE TABLE copie (
>     id serial NOT NULL primary key,

> CREATE TABLE prestiti (
>     id_copia integer references copie(id)

> CREATE TABLE testi_fermi_prenotati (
>     id_copia integer NOT NULL references copie(id),

Are you sure you don't have any null values in prestiti.id_copia?

   Richard Huxton
   Archonet Ltd

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2004-06-23 14:54:58
Subject: Re: 7.5-dev, pg_dumpall, dollarquoting
Previous:From: Alexander CohenDate: 2004-06-23 14:38:03
Subject: Re: creating a cluster

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group