mysql汇总来自多个表

时间:2016-02-28 08:47:56

标签: php mysql

我有两个表:tb_subjoe和tb_deliverydetails

我需要总结价格和数量列。在我的代码mysql当我做

 SELECT scode_id, scode_detail, deli_quote, SUM(deli_dequan) AS QUANTITY, SUM(deli_goodsprice) AS Good price, SUM(deli_wagesprice) AS Wage price 
FROM tb_deliverydetails 
LEFT JOIN tb_subjob 
    ON tb_subjob.scode_id = tb_deliverydetails.scode_id 
GROUP BY `deli_quote`

它没有回答我

enter image description here

0 个答案:

没有答案