下面是我用来显示用户和mySQL使用PHP访问次数相同或超过2次的访问次数的查询:
SELECT `token`, `visits`, `id` FROM `general` where `visits` >='2' ORDER BY `visits` DESC
Tokens with more than 2 visits
token number_of_visits
token number_of_visits
token number_of_visits
我的问题是如何在群组中有效地显示令牌以及下面的访问次数(数量)?有效地,我的意思是不(如果可能的话)对每个组(例如5 > visits < 3
和另一个visits = 2
以下是演示:
Tokens with 2 visits only
token number_of_visits
token number_of_visits
token number_of_visits
Tokens with 3 to 5 visits only
token number_of_visits
token number_of_visits
token number_of_visits
Tokens with 6 to 10 visits only
token number_of_visits
token number_of_visits
token number_of_visits
Tokens with more than 10 visits
token number_of_visits
token number_of_visits
token number_of_visits
仅限2次访问的示例数据
224e4b689a032437c9dac980813e7337(2)
6d5a68ac59263a6e17624cbcfc652a2c(2)
70fd62a88a447d84869ee8104d3befe4(2)
9280791db1d2b1679d63b9d0c9231208(2)
谢谢