すべてのアイテムを取得するためのこのSQLがあります
SELECT A.item_code,A.description,A.uom, A.open_stock, B.recd_total, C.issue_qty
FROM chem_master as A
LEFT JOIN ( SELECT item_code, sum(recd_qty) as recd_total
from chem_reciepts GROUP BY item_code) as B on A.item_code=B.item_code
LEFT JOIN(SELECT item_code, sum(iss_qty) as issue_qty
from chem_issue GROUP BY item_code) as C on A.item_code=C.item_codeand
返されるデータは
Item_code Description unit op.stock recd_total issue_qty
25139 ALUMINIUM OXIDE ACTIVE NEUTRAL GM 0 0 0
54006 L-ASCORBIC ACID GM 0 0 0
AC001 ACETIC ACID GLACIAL LTR 0 14 2
AC002 ACETONE AR LTR 0 0 0
AC005 ACACIA POWDER GM 0 0 0
私はそれらのレコードだけが欲しいopen_stock + recd_total - issue_qty = 0
SQLを変更するには?