On Tue, Jan 17, 2006 at 10:00:28PM +0000, Daniel Afonso Heisler wrote: > When i run the following query, postgreSQL return TRUE. > # SELECT true WHERE 1 NOT IN (2,3); > > But, when i run the next query, it don't return TRUE > # SELECT true WHERE 1 NOT IN (2,NULL,3);
The expression "1 NOT IN (2,NULL,3)" evaluates to NULL because NULL means "unknown." This comes up occasionally; see the archives for past discussion. http://archives.postgresql.org/pgsql-sql/2005-12/msg00219.php http://archives.postgresql.org/pgsql-sql/2005-10/msg00227.php -- Michael Fuhr ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings