Re: why these results? - Mailing list pgsql-sql

From Steve Crawford
Subject Re: why these results?
Date
Msg-id 4E37304A.2020801@pinpointresearch.com
Whole thread Raw
In response to why these results?  (Wes James <comptekki@gmail.com>)
Responses Re: why these results?  (Wes James <comptekki@gmail.com>)
List pgsql-sql
On 08/01/2011 03:50 PM, Wes James wrote:
> select count(*) from table;
>
> count
> -------
>     100
> (1 row)
>
>
> is correct
>
> select count(*) from table where col::text ~~* '%text%';
>
> count
> -------
>       1
> (1 row)
>
> is correct.
>
> But now if I do:
>
>
> select count(*) from table where col::text !~~* '%text%';
> count
> -------
>    98
> (1 row)
>
> Shouldn't it be 99?  That is out of 100 records there is one that has
> "text" in column "col" so the !~~* should return 99 rows.  ??
>
> -wes
>
select count(*) from table where col is null;

(null is neither equal nor not-equal to anything, even null)

Cheers,
Steve


pgsql-sql by date:

Previous
From: Reinoud van Leeuwen
Date:
Subject: Re: why these results?
Next
From: Wes James
Date:
Subject: Re: why these results?