Re: SELECT WHERE NOT, is not working

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: MargaretGillon(at)chromalloy(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT WHERE NOT, is not working
Date: 2005-01-05 22:44:45
Message-ID: 1879.1104965085@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

MargaretGillon(at)chromalloy(dot)com writes:
> I have a small table in which I have a Character(1) field called reengine.
> The field either has an "X" or is empty. This field does not have NULL
> values. There are 27 records in the table, 25 are marked with an 'X' in
> reengine.

> When I write
> select count(*) from resource where reengine = 'X';
> the result is 25

> when I write
> select count(*) from resource where NOT (reengine = 'X');
> the result is zero even though there are two records without the 'X'.

I don't think I believe your statement that those records don't have
NULL values.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message MargaretGillon 2005-01-05 22:51:12 Re: SELECT WHERE NOT, is not working
Previous Message Ragnar Hafstað 2005-01-05 22:43:07 Re: SELECT WHERE NOT, is not working