Ed,

>Can someone tell me why this fails? I'm using v4.1.11
>Select IF(((Select 1+1) <> Null) and ((Select 1+1) <> 0), (Select 1+1), 'WRONG')
>I would expect a result of 2.

NULL is neither equal nor unequal to anything including itself.

To get the result you expect, write

Select IF(((Select 1+1) IS NOT Null) and ((Select 1+1) <> 0), (Select 1+1), 'WRONG');

PB
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.12/220 - Release Date: 1/3/2006

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to