Hi

This definition (from the manual) is self-contradicting: 1 OR NULL
should evaluate to 1 because "any operand is non-zero", but it should
also evaluate to NULL because "any operand is NULL".

Why self-contradicting ? If you apply this rule as described ( from left to right ) you will get correct result. And it isn't work in 4.1.7 :(( As you see my first query work as described in definition but when i use aggregate function - it doesn't work.


Thanks

OR
||

Logical OR. Evaluates to 1 if any operand is non-zero, to NULL if any operand 
is NULL, otherwise 0 is returned.

mysql> SELECT 1 || 1;
         -> 1
mysql> SELECT 1 || 0;
         -> 1
mysql> SELECT 0 || 0;
         -> 0
mysql> SELECT 0 || NULL;
         -> NULL
mysql> SELECT 1 || NULL;
         -> 1


mysql> select 1 or null;
+-----------+

| 1 or null |

+-----------+

|         1 | -> Ok

+-----------+
1 row in set (0.00 sec)
>>
mysql> create table a ( a int not null );
Query OK, 0 rows affected (0.00 sec)

mysql> select min( a ) is null from a;
+------------------+

| min( a ) is null |

+------------------+

|                1 | -> Ok

+------------------+
1 row in set (0.00 sec)


mysql> select min( a ) is null or null from a; +--------------------------+

| min( a ) is null or null |

+--------------------------+

|                     NULL | -> Why ???

+--------------------------+
1 row in set (0.00 sec)



--
--------------------------------------------------------------------------------
Vlad A. Shalnev
E-mail: [EMAIL PROTECTED]

"Gravity can't be blamed
        for someone
                falling in love"

                        ( Albert Einstein )

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



Reply via email to