【发布时间】:2014-03-12 03:16:27
【问题描述】:
有人知道如何按计数过滤 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。在这个版本中是否可以按计数过滤结果?
【问题讨论】:
标签: select count where sphinx sphinxql