Thursday, 22 August 2013

mysql query display instead of NULL - 0

mysql query display instead of NULL - 0

I Have this query
SELECT
A.cod_material,
SUM(B.cantidad_pedido) as cantidad_pedido
FROM materiales AS A LEFT JOIN ingreso_material AS B
on A.cod_material = B.cod_material GROUP BY A.cod_material;
My results are
cod_material - cantidad_pedido
--------------------------------
321010001 NULL
321010002 25125
321010004 1283
321010006 NULL
And i want it to show instead of NULL (0)
321010001 0
ty for your help

No comments:

Post a Comment