21,891
社区成员
发帖
与我相关
我的任务
分享select HOUR(`atvtime`) as hh,count(*) as cnt from bao_players_info WHERE `atvtime` >= 1282838400 AND `atvtime` <1283011199 group by hhSELECT
CASE
WHEN `atvtime` >1282665600
AND `atvtime` <=1282669200
THEN '1'
WHEN `atvtime` >1282669200
AND `atvtime` <=1282672800
THEN '2'
WHEN `atvtime` >1282672800
AND `atvtime` <=1282676400
THEN '3'
WHEN `atvtime` >1282676400
AND `atvtime` <=1282680000
THEN '4'
WHEN `atvtime` >1282680000
AND `atvtime` <=1282683600
THEN '5'
WHEN `atvtime` >1282683600
AND `atvtime` <=1282687200
THEN '6'
WHEN `atvtime` >1282687200
AND `atvtime` <=1282690800
THEN '7'
WHEN `atvtime` >1282690800
AND `atvtime` <=1282694400
THEN '8'
WHEN `atvtime` >1282694400
AND `atvtime` <=1282698000
THEN '9'
WHEN `atvtime` >1282698000
AND `atvtime` <=1282701600
THEN '10'
WHEN `atvtime` >1282701600
AND `atvtime` <=1282705200
THEN '11'
WHEN `atvtime` >1282705200
AND `atvtime` <=1282708800
THEN '12'
WHEN `atvtime` >1282708800
AND `atvtime` <=1282712400
THEN '13'
WHEN `atvtime` >1282712400
AND `atvtime` <=1282716000
THEN '14'
WHEN `atvtime` >1282716000
AND `atvtime` <=1282719600
THEN '15'
WHEN `atvtime` >1282719600
AND `atvtime` <=1282723200
THEN '16'
WHEN `atvtime` >1282723200
AND `atvtime` <=1282726800
THEN '17'
WHEN `atvtime` >1282726800
AND `atvtime` <=1282730400
THEN '18'
WHEN `atvtime` >1282730400
AND `atvtime` <=1282734000
THEN '19'
WHEN `atvtime` >1282734000
AND `atvtime` <=1282737600
THEN '20'
WHEN `atvtime` >1282737600
AND `atvtime` <=1282741200
THEN '21'
WHEN `atvtime` >1282741200
AND `atvtime` <=1282744800
THEN '22'
WHEN `atvtime` >1282744800
AND `atvtime` <=1282748400
THEN '23'
WHEN `atvtime` >1282748400
AND `atvtime` <=1282751999
THEN '24'
END ct2, count( * ) AS ct
FROM bao_players_info
WHERE `atvtime` >=1282665600
AND `atvtime` <=1282751999
AND `atvgamestype` =11
GROUP BY
CASE
WHEN `atvtime` >1282665600
AND `atvtime` <=1282669200
THEN '1'
WHEN `atvtime` >1282669200
AND `atvtime` <=1282672800
THEN '2'
WHEN `atvtime` >1282672800
AND `atvtime` <=1282676400
THEN '3'
WHEN `atvtime` >1282676400
AND `atvtime` <=1282680000
THEN '4'
WHEN `atvtime` >1282680000
AND `atvtime` <=1282683600
THEN '5'
WHEN `atvtime` >1282683600
AND `atvtime` <=1282687200
THEN '6'
WHEN `atvtime` >1282687200
AND `atvtime` <=1282690800
THEN '7'
WHEN `atvtime` >1282690800
AND `atvtime` <=1282694400
THEN '8'
WHEN `atvtime` >1282694400
AND `atvtime` <=1282698000
THEN '9'
WHEN `atvtime` >1282698000
AND `atvtime` <=1282701600
THEN '10'
WHEN `atvtime` >1282701600
AND `atvtime` <=1282705200
THEN '11'
WHEN `atvtime` >1282705200
AND `atvtime` <=1282708800
THEN '12'
WHEN `atvtime` >1282708800
AND `atvtime` <=1282712400
THEN '13'
WHEN `atvtime` >1282712400
AND `atvtime` <=1282716000
THEN '14'
WHEN `atvtime` >1282716000
AND `atvtime` <=1282719600
THEN '15'
WHEN `atvtime` >1282719600
AND `atvtime` <=1282723200
THEN '16'
WHEN `atvtime` >1282723200
AND `atvtime` <=1282726800
THEN '17'
WHEN `atvtime` >1282726800
AND `atvtime` <=1282730400
THEN '18'
WHEN `atvtime` >1282730400
AND `atvtime` <=1282734000
THEN '19'
WHEN `atvtime` >1282734000
AND `atvtime` <=1282737600
THEN '20'
WHEN `atvtime` >1282737600
AND `atvtime` <=1282741200
THEN '21'
WHEN `atvtime` >1282741200
AND `atvtime` <=1282744800
THEN '22'
WHEN `atvtime` >1282744800
AND `atvtime` <=1282748400
THEN '23'
WHEN `atvtime` >1282748400
AND `atvtime` <=1282751999
THEN '24'
END
LIMIT 0 , 30 select count(*) from table_name where time > startime and time < endtime