home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.databases.sybase
- Path: sparky!uunet!math.fu-berlin.de!ira.uka.de!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!utcsri!newsflash.concordia.ca!mizar.cc.umanitoba.ca!mctrf
- From: mctrf@ccu.umanitoba.ca (Manitoba Cancer Treatment Mctrf Research)
- Subject: NULL value
- Message-ID: <C1J8FA.Fpv@ccu.umanitoba.ca>
- Sender: news@ccu.umanitoba.ca
- Nntp-Posting-Host: ccu.umanitoba.ca
- Organization: University of Manitoba, Winnipeg, Manitoba, Canada
- Distribution: na
- Date: Wed, 27 Jan 1993 21:45:09 GMT
- Lines: 36
-
- "When you compare a null value with another value the result is
- never true; a null value does not match anything, not even another
- null value"
- --- Chapter 2, Transact-SQL User's Guide
-
- Fine. But I didn't really expect the following.
-
- 1> if convert(int, NULL) = convert(int, NULL)
- 2> print '*** YES ***'
- 3> else
- 4> print '*** NO ***'
- 5> go
- *** NO ***
- 1> if NOT (convert(int, NULL) = convert(int, NULL))
- 2> print '*** YES ***'
- 3> else
- 4> print '*** NO ***'
- 5> go
- *** NO ***
-
- To solve the "contradiction" between the two IF's, I have to really
- understand next quotation.
-
- "Computations involving NULL evaluate to NULL, because the result
- must be unknown if any of the factors is unknown."
- --- Chapter 2, Transact-SQL User's Guide
-
-
- So, conceptually at least, a Boolean expression evaluates to TRUE, FALSE
- or NULL, and neither NULL nor (NOT NULL) is TRUE!
-
- I'm using Sybase SQL server 4.0.1.
-
- Vincent Yin
- mctrf@ccu.umanitoba.ca
-
-