select a.num , a.success , a.num - a.success as fail
from
(
SELECT
count(1) AS num,
count(case when detail_voucher_id is not null then detail_voucher_id end ) AS success
FROM fm_account_recharge
where date_format(pay_finish_time, '%Y-%m-%d') = date_format('2018-02-24','%Y-%m-%d')
and recharge_mode = 1
) a
mysql count 各种情况 case when
最新推荐文章于 2023-12-04 10:59:31 发布