EnexoOnoma
EnexoOnoma

Reputation: 8836

How to get the COUNT of this mySQL query?

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

Answers (1)

Jester
Jester

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

Related Questions