From: Adrian Klaver <adrian.klaver@gmail.com>
To: pgsql-sql@postgresql.org
Cc: Wes James <comptekki@gmail.com>
Subject: Re: why these results?
Date: Mon, 1 Aug 2011 16:00:31 -0700
Message-ID: <201108011600.31822.adrian.klaver@gmail.com> (raw)
In-Reply-To: <CAFjCMHuntvFO7SsGYNQrDjUwXazfnu5dgYA0BOh4eX0VcABzeA@mail.gmail.com>
References: <CAFjCMHuntvFO7SsGYNQrDjUwXazfnu5dgYA0BOh4eX0VcABzeA@mail.gmail.com>
On Monday, August 01, 2011 3:50:00 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. ??
NULL value in field?
>
> -wes
--
Adrian Klaver
adrian.klaver@gmail.com
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: adrian.klaver@gmail.com, comptekki@gmail.com
Subject: Re: why these results?
In-Reply-To: <201108011600.31822.adrian.klaver@gmail.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