gpt4 book ai didi

mysql - 如何获取此 mySQL 查询的 COUNT?

转载 作者:行者123 更新时间:2023-11-29 11:37:24 26 4
gpt4 key购买 nike

如何获取以下查询的行数?

select
hash,page,timestamp, count(*) as total
from behaviour
group by hash,page
having total > 2 AND timestamp >= Now() - interval 5 minute

最佳答案

只需查询即可解决:

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

关于mysql - 如何获取此 mySQL 查询的 COUNT?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36357160/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com