Subselects error


#1

I’m sorry, I have a lot of problems。

MySQL [(none)]> select * from (select * from test1 where match('@keyword_id =php') group by cid );
ERROR 1064 (42000): sphinxql: syntax error, unexpected $end, expecting ORDER near ')'

#2

Can anyone help me solve the problem?


#3

Subselect support is pretty strict (and has some limitations) in Manticore, it expects an ORDER clause in the outer select:
https://docs.manticoresearch.com/latest/html/sphinxql_reference/select_syntax.html#subselects

Also why to use a subselect there? You can simply group by in a single query.


#4
`MySQL [(none)]> select * from (select id,(count(*)+score) c from test where MATCH('@c_id =24004') group by
k_id) order by c desc limit 1000;`

ERROR 1064 (42000): sphinxql: syntax error, unexpected '(' near '(*)+score) c from test where MATCH('@c_id =24004') group by k_id) order by c+1 desc limit 1000'
MySQL [(none)]>

select * from (select id,(count(*)+score) c from test where MATCH(’@c_id =24004’) group by
k_id) order by c desc limit 1000;`


#5

count() is not supported in expressions.


#6

i need,Is there any other way?


#7

I’m afraid no. You can add a feature request in github.
Is score an attribute? Why would be mixed with group count?


#8

Because projects need complex operations and sorting in big data.


#9

Hello, you can also go for the paid development and fill up the form on our site https://manticoresearch.com/professional-support/