题解 | 统计商家不同会员每日访问人次及访问人数count() group by order by
select vip, count(vip) visit_nums, count(distinct v.user_id) visit_users from visit_tb v left join uservip_tb u on v.user_id=u.user_id group by vip order by visit_nums desc
select vip, count(vip) visit_nums, count(distinct v.user_id) visit_users from visit_tb v left join uservip_tb u on v.user_id=u.user_id group by vip order by visit_nums desc
相关推荐