我有這個疑問MySQL查詢顯示,而不是NULL - 0
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;
我的結果是
cod_material cantidad_pedido
--------------------------------
10001 NULL
10002 25125
10004 1283
10006 NULL
而且我想讓它顯示的,而不是NULL(0)
321010001 0
Ty for your help
最好的辦法是改變你的表格,並給他們的0 – Sebastien