select source,count(source) as cnt
from 
(select o.id,case c.id when 1 then "PC"
                      when 2 then "Android"
                      when 3 then "IOS"
                      when 4 then "H5"
                      else "GroupBuy"
            end as source
from order_info o
left join client c
on o.client_id=c.id
where o.date>"2025-10-15"
and o.product_name in ("C++","Python","Java")
and o.status='completed'
and o.user_id in (select user_id from
                 (select id, user_id ,row_number() over (partition by user_id order by id)rr 
                  from order_info
                  where status='completed'
                  and product_name in ("C++","Python","Java"))r
                  where r.rr>=2)
)a
group by source
order by source