如何才能获得以下查询中的行数?
select
hash,page,timestamp, count(*) as total
from behaviour
group by hash,page
having total > 2 AND timestamp >= Now() - interval 5 minute
答案 0 :(得分:1)
仅通过查询解决方案:
SELECT COUNT(*)
FROM (
select
hash,page,timestamp, count(*) as total
from behaviour
group by hash,page
having total > 2 AND timestamp >= Now() - interval 5 minute) AS t1