select
case
when a.pay_method = '' then 'error'
else pay_method
end as py,
count(a.pay_method) as cnt
from
user_client_log a
left join product_info b using (product_id)
where
a.step ='select'
and b.product_name = 'anta'
group by
a.pay_method
order by
cnt desc

京公网安备 11010502036488号