RX
求(在某个time里,js_id出现最多的)
比如times=1026,js_id=11(表名是topclick)js_id times
11 1026
12 1026
11 1026
11 1026
13 1025
求(在某个time里,js_id出现最多的)
比如times=1026,js_id=11(表名是topclick)js_id times
11 1026
12 1026
11 1026
11 1026
13 1025
from topclick
where times='1026'
group by js_id
order by total desc limit 1;
从这里边找出你想要的随便哪个js_id 最多的就行
下面写法有更好地可读性:
select js_id,count(times) as total
from topclick
where times='1026'
group by js_id
order by total desc limit 1;