Reputation: 8836
How can I just get the number of rows on the below query?
select
hash,page,timestamp, count(*) as total
from behaviour
group by hash,page
having total > 2 AND timestamp >= Now() - interval 5 minute
Upvotes: 0
Views: 28
Reputation: 1408
Solution by just querying:
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
Upvotes: 1