0

有人知道如何按计数按查询过滤 sphinxql 组吗?例如,我有如下查询:

SELECT collection_id, count(*) as cnt 
FROM mobile_content 
WHERE collection_id != 0 
GROUP BY collection_id

而且我只想得到 cnt 大于 5 的行。如果我做这样的事情,我会得到一个错误:

SELECT collection_id, count(*) 
FROM mobile_content 
WHERE collection_id != 0 AND count(*) > 5 
GROUP BY collection_id;

ERROR 1064 (42000): sphinxql: Aggregates in 'where' clause prohibited near '5 GROUP BY collection_id'

我记得在旧版本中,我使用 @count 按结果过滤分组。

我当前的 sphinxsearch 版本是 2.1.5。在这个版本中是否可以按计数过滤结果?

4

1 回答 1

1

My current sphinxsearch version is 2.1.5. Is it possible to filter results by count in this version?

No.

The HAVING clause, was added in 2.2.1-beta

http://sphinxsearch.com/docs/current.html#sphinxql-select

于 2014-02-13T15:47:40.440 回答