with cte as( select customer_id,COUNT(*) as c1, COUNT(CASE when client_id="desktop" THEN 1 ELSE NULL END) as x1 FROM fact_events GROUP BY customer_id ) select customer_id FROM (select cte.*,DENSE_RANK()OVER(ORDER BY c1 DESC) as r1 FROM cte where c1=x1) as es where r1=1;
@HARSHRAJ-gp6veАй бұрын
Bro if you find any kind of error in my query on any solutions I post in it, plese comment also for the same