直接贴上代码
select name,count(1) from (select name,mac from t_visitlog group by mac,name)t group by order by count(1) desc;
这个需求时 统计不同的mac地址的不同name的个数
加个时间
select name,count(1) from (
select name,mac from t_visitlog where gettime like '2015-04-19%'
group by mac,name)t group by order by count(1) desc;