Re: SELECT WHERE NOT, is not working

From: Alex Turner <armtuk(at)gmail(dot)com>
To: "MargaretGillon(at)chromalloy(dot)com" <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:11:18
Message-ID: 33c6269f050105141175881925@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Try:

select count(*) from resource where reengine <> 'X';

Alex Turner
NetEconomist

On Wed, 5 Jan 2005 13:51:58 -0800, MargaretGillon(at)chromalloy(dot)com
<MargaretGillon(at)chromalloy(dot)com> wrote:
> 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.
>
> I am querying the table from pgadmin v1.1.0 for windows.
>
> 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 have also tried:
> select * FROM RESOURCE where reengine > 'X';
> select * FROM RESOURCE where reengine < 'X';
> select * FROM RESOURCE where reengine = '';
>
> but nothing works except the " reengine = 'X' "
>
> I have other fields in this table that I can query with the "NOT" and the
> query works.
>
> The records are being written with insert statements from a Windows2000
> computer using ODBC.
>
> Can someone explain this. I tried looking in archives but didn't find
> anything.
>
> *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
> ***
> Margaret Gillon, IS Dept., Chromalloy Los Angeles, ext. 297
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ragnar Hafstað 2005-01-05 22:32:24 Re: SELECT WHERE NOT, is not working
Previous Message Alex Turner 2005-01-05 22:09:24 Re: Trigger Question