【发布时间】:2018-11-16 04:15:51
【问题描述】:
SELECT COUNT(*) AS customer, t.state
FROM tbl_parcel_item t
WHERE t.courier_name='Tnt'
AND t.date = '2018-03-12'
AND t.ship_status NOT IN (0,1,9,10)
GROUP BY t.state`
根据上面的 sql,结果将是: enter image description here 如何使其获得上述结果的总和,例如: enter image description here
【问题讨论】:
-
使用 sum(customer) 作为总数
标签: mysql sql phpmyadmin