RE: [BUG?] SELECT STATEMENT ON COLUMN WITH NULLS

"Schroeder, Alexander" <[email protected]>
Newsgroups gmane.comp.db.sapdb.general
Message-ID <[email protected]>
Hello Kevin,

YES, there was already some discussion about this topic several times
(and a long time ago), and NO this is not a bug. 

SQL defines the uniqueness of that NULL value in that way.

That means:

  Its relationship to any other value is always unknown.

meaning any comparision returning false, even the '<>' with a value.

Read more in this posting:

  http://listserv.sap.com/pipermail/sapdb.general/2002-October/031622.html

Regards

Alexander Schröder
SAP DB, SAP Labs Berlin 

> -----Original Message-----
> From: Kevin Wilson [mailto:[email protected]]
> Sent: Thursday, August 14, 2003 4:53 PM
> To: Sapdb General List (E-mail)
> Subject: [BUG?] SELECT STATEMENT ON COLUMN WITH NULLS
> 
> 
> I apologize if this has been reported already but here it is anyway.
> 
> 1) I have an ASCII column called STATUS that allows NULL.
> 2) There are 190k+ records with mixed values in this column.
> 3) Running the following query causes the column that has 
> 	the value of NULL to be filtered out which results in 
> 	a inaccurate count:
> 
> 	select COUNT(*) from call 
> 	where status != 'CLOSED'
> 
> 4) Running the following query allows the NULL values to be counted:
> 
> 	select COUNT(*) from call 
> 	where status != 'CLOSED' OR STATUS IS NULL	
> 
> This occurs in both the SQL Studio as well as the JDBC driver 
> and I will
> guess that the ODBC driver is affected as well.
> 
> [Sys Info]
> SAPDB v7.3.0.34 (ASCII) on SuSE v8.1
> 
> 
> Please advise if this was previously reported and I simply 
> missed it and
> need to update to .40 of the server.
> 
> Thanks,
> 
> Kevin
> 
> "Those who would give up essential liberty to purchase a 
> little temporary
> safety deserve neither liberty nor safety."
>      -Benjamin Franklin, 1759 
> _______________________________________________
> sapdb.general mailing list
> [email protected]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.