题解 | 商品销售总额分布
商品销售总额分布
https://www.nowcoder.com/practice/62909494cecd4eab8c2501167e825566
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
查看4道真题和解析
