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

posted @ 2019-09-18 10:43  沧海一粟95  阅读(2727)  评论(0编辑  收藏  举报