0、基础知识
(1)pv:page view(页面访问量)
(2)uv:user view(访问人数)
(3)uv表的数据如下
(4)统计每个月的用户浏览量,"distinct"关键字是去除重复的值
select month, count(distinct id) from uv group by month;
1、union all:表联合操作
eg:统计每天和每月的用户访问量
select month, count(distinct id) from uv group by month union all select day, count(distinct id) from uv group by day;