MySQL同时统计两个条件的记录条数

SELECT count(case when `status`=5 then 1 else null end) as countOk,
count(case when `status`=8 then 1 else null end) as countNo FROM mtl_order where store_id = 92

只有O和1的世界是简单的!
原文地址:https://www.cnblogs.com/hinux/p/11540259.html