"Chris Boget" <[EMAIL PROTECTED]> wrote:
> We are running v4.0.12.
> 
> Consider the following:
> 
> mysql> SELECT MAX(assets) as assets
>    -> FROM do_deductibles
>    -> WHERE currency = 'usd';
> +--------+
> | assets |
> +--------+
> |   NULL |
> +--------+
> 1 row in set (0.00 sec)
> 
> mysql> SELECT MAX(assets) as assets
>    -> FROM do_deductibles
>    -> WHERE currency = 'usd' AND 
>    -> assets IS NOT NULL;
> +----------+
> | assets   |
> +----------+
> | 10000000 |
> +----------+
> 1 row in set (0.00 sec)
> 
> mysql> SELECT MAX(assets) as assets
>    -> FROM do_deductibles
>    -> WHERE currency = 'usd';
> +----------+
> | assets   |
> +----------+
> | 10000000 |
> +----------+
> 1 row in set (0.00 sec)
> 
> What's going on with the MAX() function?  Why did it return NULL
> in the first query above.  There were no adding/deleting data between
> the above queries and yet MySQL didn't pull the MAX from the table
> until I added the "AND assets IS NOT NULL" to the query.  And yet
> after I ran that query, attempting to run the first query yields the proper
> results.
> Is this a bug with MySQL?

I wasn't able to repeat it on my test table. Could you provide a test case? 


-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





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

Reply via email to