我有声明
SELECT COUNT(*) as num_requests, ip_address FROM requests
GROUP BY ip_address
ORDER BY num_requests DESC;
当我使用以下子句时WHERE num_requests = 3
,出现语法错误
SELECT COUNT(*) as num_requests, ip_address
FROM requests
WHERE num_requests = 3
GROUP BY ip_address
ORDER BY num_requests DESC;
“where 子句”中的未知列“num_requests”
有没有什么方法可以使用这个WHERE
子句,而无需在上面返回的整个结果集上编写嵌套查询或连接语句?