题解 | 商品销售总额分布

商品销售总额分布

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

全部评论

相关推荐

牛客36400893...:我不是这个专业的,但是简历确实没有吸引我的亮点,而且废话太多没耐心看
0offer是寒冬太冷还...
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
10-29 21:14
疯犬丨哈士奇:喜欢你的人会主动表白,对你有想法的人会很主动,所以要你的公司不会吊着你所以懂了吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务