select
pay_method,
count(*) as cnt
from (
select
if(pay_method = '','error',pay_method) as pay_method
from
user_client_log
where
product_id =
(select product_id
from product_info
where product_name = 'anta')
and
step = 'select'
)a
group by
pay_method
order by
cnt desc


京公网安备 11010502036488号