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