Re: no cond returns diff res than cond or !cond

Поиск
Список
Период
Сортировка
От Haller Christoph
Тема Re: no cond returns diff res than cond or !cond
Дата
Msg-id 200111121446.PAA23138@rodos
обсуждение исходный текст
Ответ на no cond returns diff res than cond or !cond  (Markus Bertheau <twanger@bluetwanger.de>)
Список pgsql-sql
Hi Markus, 
AFAIK the SQL standard says for querying columns to be NULL 
resp. NOT NULL 
select count(*) from produkte where artnummer is NULL or 
artnummer is NOT NULL ; 
Please try and let me know about your results. 
Regards, Christoph 
> 
> Good day,
> 
> feline=> select version();
>                             version                            
> ---------------------------------------------------------------
>  PostgreSQL 7.0.2 on i686-pc-linux-gnu, compiled by gcc 2.95.2
> (1 row)
> 
> feline=> select count(*) from produkte;
>  count 
> -------
>  36405
> (1 row)
> 
> feline=> select count(*) from produkte where artnummer != NULL or
> artnummer = NULL;
>  count 
> -------
>  36347
> (1 row)
> 
> cenes_test=> select version();
>                            version                           
> -------------------------------------------------------------
>  PostgreSQL 7.1.3 on i686-pc-linux-gnu, compiled by GCC 2.96
> (1 row)
> 
> cenes_test=> select count(*) from produkte;
>  count 
> -------
>  36384
> (1 row)
> 
> cenes_test=> select count(*) from produkte where artnummer = NULL or
> artnummer != NULL;
>  count 
> -------
>  36326
> (1 row)
> 
> 2nd query 58 less than first.
> 
> bug?
> 
> Markus Bertheau
> 
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 



В списке pgsql-sql по дате отправления:

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: no cond returns diff res than cond or !cond
Следующее
От: Haller Christoph
Дата:
Сообщение: Re: integer attribute 1672 != 1672