> +------------+----------+
>
> | id_ingenio | cantidad |
>
> +------------+----------+
>
> |          1 |     NULL |
> |          2 |     NULL |
> |          3 |     NULL |
> |          4 |  2622.77 |
> |          5 |     NULL |
>
> +------------+----------+
> 5 rows in set (0.01 sec)

You can use DEFAULT 0 to set a column to 0 by default.  You can also do it in 
one pass through:

(test with this first):

SELECT id_ingenio,cantidad FROM detalle_transaccion WHERE cantidad IS NULL;

if that gives you the correct result set then:

UPDATE detalle_transaccion SET cantidad = 0 WHERE cantidad IS NULL;

-- 
Chris White
PHP Programmer/DBamBam
Interfuel

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

Reply via email to