select pay_method_new, count(1) as cnt
from (
select product_id, pay_method,
case when (pay_method is null or pay_method='') then 'error' else pay_method end as pay_method_new
from user_client_log
where step='select'
) a join product_info b on a.product_id=b.product_id
where product_name='anta'
group by pay_method_new
order by cnt desc
题目中用空字符串'',is null 无法捕获,需要用 pay_method=''

京公网安备 11010502036488号