select true_method, count(*) as cnt from ( select product_id, ( case when step="select" and (pay_method="" or pay_method is null) then "error" when step="" or step=null then null else pay_method end ) as true_method from user_client_log ) as ucl where exists ( select 1 from product_info as pi where ucl.product_id=pi.product_id and pi.product_name="anta" ) and true_method is not null and true_method != "" group by true_method order by cnt desc