0

使用SphinxQl,在执行此查询时,我收到以下错误

  select fieldname from indexname where height >= 165.25 and height <= 175.25 OR Age >=51;
 ERROR 1064 (42000): sphinxql: syntax error, unexpected OR, expecting $end near 'OR Age >=51'

 select fieldname from indexname where (height >= 165.25 and height <= 175.25) OR Age >=51;

ERROR 1064 (42000): sphinxql: only >=, <=, and BETWEEN floating-point filter types are supported in this version near '(height >= 165.25 and height <= 175.25) OR Age >=51'

提前谢谢,请建议

4

1 回答 1

1

尝试类似的东西

SELECT fieldname, IF( (height >= 165.25 AND height <= 175.25) OR Age >=51, 1, 0)
AS myfilter FROM indexname WHERE myfilter = 1

狮身人面像可以做“或”,他们只是不能物理上在 WHERE 子句本身。

于 2013-03-05T13:09:50.153 回答