why these results?

From: Wes James <comptekki(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: why these results?
Date: 2011-08-01 22:50:00
Message-ID: CAFjCMHuntvFO7SsGYNQrDjUwXazfnu5dgYA0BOh4eX0VcABzeA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Adrian Klaver 2011-08-01 23:00:31 Re: why these results?
Previous Message THOMPSON, JARED (ATTBAPCO) 2011-07-29 17:48:50 Re: to_char() accepting invalid dates?