编辑:I have a mysql table for items in and items out displayed as follows
当我运行以下查询以显示输入的项目数和拍摄的项目时,我得到以下结果。
Results after running the query
查询如下:
SELECT DISTINCT ii.item_in_nme 'Items In'
, SUM(ii.item_in_quantity) 'Quantity In'
, io.item_out_nme 'Items Taken'
, SUM(item_out_quantity) 'Quantity Taken'
, item_taken_by 'Taken By'
, SUM(ii.item_in_quantity) - SUM(item_out_quantity) 'Available quantity'
FROM items_in ii
JOIN items_out io
ON io.item_out_nme = ii.item_in_nme
GROUP
BY ii.item_in_nme
, io.item_out_nme
糖量显示出一个奇怪的数字。
你能帮我辨别出错了吗