当我运行程序时,数字的结果取而代之的是将数字合并,并使数字成许多结果。
SELECT pengiriman_supply.po_nomor
, data_supplier.nama_supplier
, data_barang.nama_barang,
((sum(pengiriman_supply.jumlah))-(ifnull(masuk.terima,0))) as total
FROM pengiriman_supply INNER JOIN data_supplier ON pengiriman_supply.idsupplier = data_supplier.id_supplier
INNER JOIN data_barang ON pengiriman_supply.idbarang = data_barang.idbarang
left JOIN masuk on masuk.refrence = pengiriman_supply.po_nomor
where pengiriman_supply.tanggal between date_sub(curdate(), interval 120 day) and curdate()
group by pengiriman_supply.po_nomor
ORDER BY pengiriman_supply.po_nomor desc;
答案 0 :(得分:0)
似乎您正在尝试获取每个sum()
的{{1}}。让我们将其放在po number
中,然后再将subquery
放入要显示信息的表中。
join