pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Steve Crawford <scrawford@pinpointresearch.com>
To: pgsql-sql@postgresql.org
Subject: Re: why these results?
Date: Mon, 01 Aug 2011 16:01:30 -0700
Message-ID: <4E37304A.2020801@pinpointresearch.com> (raw)
In-Reply-To: <CAFjCMHuntvFO7SsGYNQrDjUwXazfnu5dgYA0BOh4eX0VcABzeA@mail.gmail.com>
References: <CAFjCMHuntvFO7SsGYNQrDjUwXazfnu5dgYA0BOh4eX0VcABzeA@mail.gmail.com>

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



view thread (5+ messages)  latest in thread

Message-ID: <4E37304A.2020801@pinpointresearch.com>
Permalink:  ../4E37304A.2020801@pinpointresearch.com/
Also on:    postgresql.org/message-id/4E37304A.2020801@pinpointresearch.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scrawford@pinpointresearch.com
  Subject: Re: why these results?
  In-Reply-To: <4E37304A.2020801@pinpointresearch.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox